Compare commits

...

882 Commits

Author SHA1 Message Date
jLynx 8ba5715db0 Update version.txt 2023-05-06 08:03:59 +12:00
jLynx c7e8506ad0 Update past_version.txt 2023-05-06 08:03:44 +12:00
gullradriel 8cb0a91bb5 Merge pull request #958 from gullradriel/recon-skip-fix
fix skip consecutive match
2023-05-05 17:03:00 +02:00
GullCode 1bcbefeb96 fix skip consecutive match 2023-05-05 17:01:08 +02:00
gullradriel 31031edbd1 Merge pull request #956 from bernd-herzog/boot_improvements
removed need for cpld mode setup for QFP100
2023-05-05 15:37:58 +02:00
bernd-herzog 7116f92d07 fixed spelling 2023-05-05 13:39:04 +02:00
bernd-herzog df8e79f9e6 refactoring 2023-05-05 12:58:28 +02:00
bernd-herzog e80e4e3bfd refactoring 2023-05-05 12:58:14 +02:00
bernd-herzog da6c6bb03c refactoring 2023-05-05 12:46:59 +02:00
bernd-herzog 75718c79b9 removed need for cpld mode setup for QFP100 2023-05-05 11:15:49 +02:00
gullradriel 9b263def37 Merge pull request #954 from gullradriel/recon-fix
Recon fix
2023-05-04 15:27:47 +02:00
GullCode c7d88da1a6 restoring bad substitue on text_ctcss filler 2023-05-04 15:26:33 +02:00
GullCode 7b6f8b271c Fixed so ui glitches, start when empty file and direct click on config. Added yellow coloration when loaded file was truncated (too big). Added/changed some error messages 2023-05-04 15:20:12 +02:00
GullCode 1b18b3ac45 fixing limit so we can detect if a list is the same size as the limit or truncated 2023-05-04 15:19:13 +02:00
gullradriel 68fc2a143f Merge pull request #953 from gullradriel/freqman-limits
fixing freqman limits
2023-05-04 12:11:15 +02:00
GullCode 1deebaff09 fixing freqman limits 2023-05-04 12:09:42 +02:00
gullradriel d6118c9fc4 Merge pull request #951 from kallanreed/fileloadview-fix
Fix nav.pop order on FileLoadView
2023-05-04 07:43:54 +02:00
Kyle Reed 44a62aef21 Fix nav.pop order on FileLoadView 2023-05-03 15:29:01 -07:00
gullradriel 0742fc169d Merge pull request #950 from kallanreed/fileman_ux2
Fileman fit and finish
2023-05-03 22:32:00 +02:00
Kyle Reed 62859f901f Fix indents 2023-05-03 13:23:15 -07:00
Kyle Reed c6316f5aa6 Fileman fit and finish 2023-05-03 13:13:15 -07:00
gullradriel 5f2043d229 Merge pull request #949 from gullradriel/pmem-defaults
Pmem defaults
2023-05-03 19:51:47 +02:00
gullradriel 074658c4bb Merge branch 'eried:next' into pmem-defaults 2023-05-03 19:51:15 +02:00
GullCode d641ae5b47 Fixed size of things 2023-05-03 19:50:12 +02:00
gullradriel bec70b4ee5 Merge pull request #948 from gullradriel/pmem-defaults
Pmem defaults
2023-05-03 19:48:05 +02:00
GullCode c4373d1560 indentation 2023-05-03 19:45:01 +02:00
GullCode 1dae2c0d25 indentation 2023-05-03 19:44:08 +02:00
GullCode 658d0c9b3a Added reset persitent memory 2023-05-03 19:42:57 +02:00
gullradriel 2f343adf21 Merge pull request #941 from kallanreed/fileman_ux
Fileman UI and Perf Fixes
2023-05-03 17:13:05 +02:00
gullradriel f7a5f2c437 Merge pull request #946 from Brumi-2021/noise_Signal_Generator_LFSR_polynomial_of_16_32_bits
Leaving only 1 Noise signal generator GUI option , (the best one , using  LFSR polynomial of 16 bits)
2023-05-03 13:57:06 +02:00
Brumi-2021 5a336d5e71 Compact with unique, best Noise Gererator option. 2023-05-03 13:49:50 +02:00
gullradriel 91675e26cb Merge pull request #945 from bernd-herzog/touchscreen_multiinput_fix
fixed touch handling issue causing multiple inputs
2023-05-03 11:43:34 +02:00
bernd-herzog 078da8ca16 Improved sensitivity for non pointy touches 2023-05-03 11:18:37 +02:00
bernd-herzog 77260bc68a fixed touch handling issue causing multiple inputs 2023-05-03 10:47:43 +02:00
gullradriel ca143f9788 Merge pull request #944 from joyel24/meteomodem-M20-radiosondes-altitude
Add Meteomodem M20 radiosondes altitude
2023-05-03 06:31:47 +02:00
Kyle Reed 3fc23354ce Fix path separator, revert UI 2023-05-02 20:49:41 -07:00
joyel24 d48e25167f fix altitude inaccuracy 2023-05-03 05:37:31 +02:00
joyel24 cfe5a6bfe4 Merge branch 'eried:next' into meteomodem-M20-radiosondes-altitude 2023-05-03 02:09:20 +02:00
Brumi-2021 d77102426a Finally Noise Signal with best option 16 bit LFSR 2023-05-02 21:29:35 +02:00
Kyle Reed 11f4edc892 Modal dialog for partner file action, fix lifetime 2023-05-02 09:38:08 -07:00
Brumi-2021 804fa0d3c4 Minor GUI corrections-Signal Generator 2023-05-02 17:41:00 +02:00
Brumi-2021 d5f20c45b9 Adding 16 bit LFSR , to Noise Signal Generator App 2023-05-02 17:19:23 +02:00
Kyle Reed 2cba96ff36 Support for partner file rename/delete 2023-05-01 09:25:32 -07:00
Joel M 7139abb947 alt divided by 100 2023-05-01 16:54:29 +02:00
Kyle Reed bf4ed416bd Remove expensive path.string() calls, UI changes 2023-04-30 22:42:28 -07:00
gullradriel 06643df6a5 Merge pull request #938 from gullradriel/pmemsettings-create-folder
Added SETTINGS folder creating for PMem files
2023-04-30 18:42:51 +02:00
GullCode 81752c8d78 Added SETTINGS folder creating for PMem files 2023-04-30 18:41:24 +02:00
gullradriel 0cb8c9200a Merge pull request #937 from gullradriel/hackrf-flashing-tool-update
Updating to release 2023.01.1
2023-04-30 18:27:41 +02:00
GullCode 8e64221384 Updating to release 2023.01.1 https://github.com/greatscottgadgets/hackrf/releases/tag/v2023.01.1 2023-04-30 18:26:22 +02:00
gullradriel fe1837ec23 Merge pull request #936 from Brumi-2021/solving_bug_in_noise_option_Signal_Generator_tool
Solving Noise generation in Signal gen App
2023-04-30 17:33:18 +02:00
Brumi-2021 ee53b28e60 Solving Noise generation in Signal gen App 2023-04-30 18:03:40 +02:00
gullradriel 18c986cd76 Merge pull request #931 from kallanreed/cursor_text_input
Add a TextField widget that supports a cursor.
2023-04-30 17:28:42 +02:00
gullradriel a1c3cbcea9 Merge pull request #935 from gullradriel/looking-glass-update
Looking glass update
2023-04-30 15:01:57 +02:00
GullCode 1135a42932 better roundings/per pixel marker 2023-04-30 14:56:17 +02:00
Joel M a74d0e5167 altitude 3 bytes 2023-04-30 13:59:21 +02:00
gullradriel c5579e25fd Merge pull request #932 from joyel24/meteomodem-M20-radiosondes
Identifying meteomodem m20 radiosondes & extract GNSS location
2023-04-30 13:25:42 +02:00
Joel M e8b8f0ca5c Disable inaccurate altitude for the moment 2023-04-30 12:06:37 +02:00
GullCode 98e7116230 Changed to per pixel marker, short freq display, adjusted <24Mhz view to look like SPEC one 2023-04-29 21:46:19 +02:00
Joel M c916eaf43f Detects M20 radiosondes and decode GNSS location 2023-04-29 14:00:28 +02:00
Joel M e3169a3495 add Meteomodem_M20 to packet class in sonde_packet.hpp 2023-04-29 13:49:27 +02:00
Kyle Reed 4b37f1bb2f Add a TestField widget that supports a cursor. 2023-04-28 19:26:53 -07:00
gullradriel cb93f2636e Merge pull request #929 from gullradriel/freq-disp-fix
Freq disp fix
2023-04-28 13:01:12 +02:00
GullCode 596c304b08 Took out unused func declaration 2023-04-28 12:59:51 +02:00
GullCode 63f7be02b6 Used correct to_string_short_freq instead of erroneous calculation 2023-04-28 12:57:00 +02:00
GullCode de99afa19b Took out unused func declaration 2023-04-28 12:55:58 +02:00
gullradriel 5c4e27ea29 Merge pull request #927 from gullradriel/dsp-warning-fix
Dsp warning fix
2023-04-27 16:08:18 +02:00
GullCode 54e4230191 indentation 2023-04-27 16:07:57 +02:00
GullCode f069383c2a Fix unused warnings in ssb_execute 2023-04-27 16:06:47 +02:00
gullradriel d3a356d415 Merge pull request #926 from gullradriel/gitignore-fix
restoring gitignore
2023-04-27 15:51:54 +02:00
GullCode f0e4fdcbcc restoring gitignore, bad move on last commit 2023-04-27 15:50:59 +02:00
ittercho d5f6f42fae Addition of water meters (#892)
Water Meters frequency list
NRK and RMF radio stations frequencies list
Fixed and ordered as much as possible PRESETS.TXT
Co-authored-by: gullradriel
2023-04-27 15:44:32 +02:00
gullradriel 7a89858cc6 Merge pull request #925 from gullradriel/level-mem-workaround
Automatically reduce rssi graph history
2023-04-27 15:42:06 +02:00
gullradriel 15c9a76536 Merge pull request #924 from bernd-herzog/dfu_menu
added frame drop rate for m4 signal processing
2023-04-27 15:41:46 +02:00
GullCode d7359a8cd5 Automatically reduce rssi graph history when hidden, restore size on show. Prevent Memory exhaustion in apps like 'Level' or any app eating a bit too much mem before launching a FrequencyPadView 2023-04-27 15:38:29 +02:00
Bernd Herzog 50e5bc60ee added frame miss rate for m4 signal processing 2023-04-26 22:28:14 +02:00
jLynx 9385be4f1e Merge pull request #920 from zxkmm/ready_to_pr_2_20230426_imp_issue_917
implemented issue#917
2023-04-27 07:01:02 +12:00
zxkmmOnHaseeWSL 9cddab9a5e fix mistakenly remane dir as file -- credit:Gull 2023-04-26 19:09:38 +08:00
zxkmmOnHaseeWSL 6e01a1d0dc change ?: to if else 2023-04-26 16:20:05 +08:00
gullradriel f73cd39d2d Merge pull request #922 from NotherNgineer/next
#910 Brighter color for .C8/.C16 files in fileman
2023-04-26 09:29:57 +02:00
Mark Thompson 0303c658ea Brighter color for .C8/.C16 files in fileman
See https://github.com/eried/portapack-mayhem/issues/910
2023-04-26 02:04:37 -05:00
gullradriel 94ddb63b1d Merge pull request #921 from zxkmm/ready_to_pr_20230426_3_textual_change_for_flash_unity
textual change for  the flash unity
2023-04-26 08:29:51 +02:00
gullradriel b1aa607a7c Merge pull request #907 from NotherNgineer/next
Support for ERT SCM+ meter protocol
2023-04-26 08:28:39 +02:00
Mark Thompson 509f86c1f7 Merge branch 'eried:next' into next 2023-04-26 01:25:46 -05:00
zxkmmOnHaseeWSL b45ca43e27 textual change for the flash unity 2023-04-26 13:29:11 +08:00
zxkmmOnHaseeWSL 47482d1e58 fixed var.clear 2023-04-26 13:22:50 +08:00
zxkmmOnHaseeWSL 59dfe5b50b implemented issue#917 2023-04-26 13:01:51 +08:00
Mark Thompson b1f5023fe1 Removed unneeded space characters 2023-04-24 15:29:51 -05:00
gullradriel a54b94fe53 Merge pull request #915 from gullradriel/recon-update
Recon description flashing on range fix
2023-04-24 21:15:56 +02:00
GullCode 45bdabcef9 Fix for description being updated at each step on a range 2023-04-24 21:14:34 +02:00
Mark Thompson 6cdada1118 Include ERT packet type in ert.txt log file 2023-04-24 09:59:43 -05:00
gullradriel cffc72c516 Merge pull request #913 from gullradriel/looking-glass-zoom
Looking glass zoom update
2023-04-24 13:56:04 +02:00
GullCode e53514aa12 tweaking scan start values and ranges, allowing <24MHz range 2023-04-24 13:51:31 +02:00
Bernd Herzog 775de5ce6f Merge pull request #912 from bernd-herzog/dfu_menu
improved stability of cpu usage calculation
2023-04-24 13:05:36 +02:00
Bernd Herzog 4ff92be23b refactoring 2023-04-24 13:04:59 +02:00
Bernd Herzog 948d8d947e improved stability of cpu usage calculation 2023-04-24 13:00:34 +02:00
jLynx 55c300ac4b Merge pull request #909 from bernd-herzog/dfu_menu
Dfu menu
2023-04-24 10:26:11 +12:00
Bernd Herzog 29b7a5ee56 improved m4 m0 communication 2023-04-23 23:48:20 +02:00
Bernd Herzog 2ef9ebd7bd implemented M4 stats 2023-04-23 21:48:45 +02:00
Bernd Herzog 850a79c9bb added m0 stats to dfu screen 2023-04-23 19:52:38 +02:00
Bernd Herzog 812f0f8211 added overlay to system view 2023-04-23 16:21:33 +02:00
jLynx d00c21adb7 Merge pull request #908 from zxkmm/ready_to_pr_20230423_fix_stealth_in_replay
fix stealth doesn't work
2023-04-23 21:11:45 +12:00
zxkmmOnHaseeWSL 925c1548a8 fix stealth doesn't work 2023-04-23 16:47:06 +08:00
jLynx cd1f1bd388 Merge pull request #906 from zxkmm/fix_fileman_refactor
fix last commit aka fileman refactor exception
2023-04-23 19:12:40 +12:00
zxkmmOnHaseeWSL 474fe00146 formatting fix 2023-04-23 14:53:06 +08:00
Mark Thompson 44b2e5ea61 Support for ERT SCM+ meter protocol 2023-04-23 01:34:56 -05:00
Mark Thompson 48ed7b1b1a Support for ERT SCM+ meter protocol 2023-04-23 01:33:42 -05:00
Mark Thompson 6201be82ea Support for ERT SCM+ meter protocol 2023-04-23 01:31:45 -05:00
Mark Thompson fe1d296b48 Support for ERT SCM+ meter protocol 2023-04-23 01:29:51 -05:00
Mark Thompson 697876d86a Support for ERT SCM+ meter protocol 2023-04-23 01:26:37 -05:00
Brumi-2021 b72c765911 Merge pull request #904 from zxkmm/ready_to_pr_20230421
make the title touchable, and back/return when touch it
2023-04-22 21:39:10 +02:00
zxkmmOnHaseeWSL 2a14888b80 fix last commit aka fileman refactor exception 2023-04-22 22:58:10 +08:00
jLynx 99f1bded4d Merge pull request #905 from zxkmm/ready_to_pr_20230422
add Refactor in fileman app
2023-04-22 21:52:53 +12:00
zxkmmOnHaseeWSL d8e9fad205 fix indentation for pr 20230422-2 2023-04-22 17:51:31 +08:00
zxkmmOnHaseeWSL 0e8dc1567c fix indentation for pr 20230422 2023-04-22 17:50:21 +08:00
zxkmmOnHaseeWSL 4ff71dcfca add Refactor in fileman app 2023-04-22 17:21:51 +08:00
zxkmmOnHaseeWSL ed0f0eb15e touchable title, little width adjust again... sorry 2023-04-22 13:31:27 +08:00
zxkmmOnHaseeWSL 193a80edea smaller touchable title 2023-04-22 13:02:41 +08:00
zxkmmOnHaseeWSL df0c85db8f touchable title 2023-04-21 21:34:18 +08:00
Bernd Herzog c5738c46d5 Merge pull request #899 from bernd-herzog/dfu_menu
Dfu button
2023-04-17 08:17:21 +02:00
Bernd Herzog 0acf7ec2c2 refactoring 2023-04-16 20:33:02 +02:00
Bernd Herzog dc560ba01f improved debug app layout 2023-04-16 20:31:14 +02:00
Bernd Herzog d74fd92451 added dfu button to debug app 2023-04-16 19:51:06 +02:00
Bernd Herzog bcefa774cd added dfu button to debug app 2023-04-16 18:23:54 +02:00
gullradriel 8382eaf45f Merge pull request #896 from gullradriel/looking-fast-slow
Looking fast slow
2023-04-13 11:11:45 +02:00
GullCode 9f700a30c0 Changed text to MAX HOLD to make a difference with existing 'MAX' 2023-04-13 11:02:32 +02:00
GullCode d815e6c952 Merge branch 'next' of github.com:gullradriel/portapack-mayhem into looking-fast-slow 2023-04-13 10:38:13 +02:00
GullCode e60ec953ab move text and button a bit so it's fitting when big 2023-04-13 10:36:15 +02:00
GullCode 72d1e21fc6 added adjust_range, fast scan and slow scan, lock/unlock range, integer division results when possible, default step of 1 2023-04-13 10:18:16 +02:00
jLynx e4d42817ee Merge pull request #895 from JimiHFord/patch-1
fix typo
2023-04-13 16:16:19 +12:00
Jimi Ford 5729bde214 fix typo 2023-04-13 00:11:30 -04:00
gullradriel ec7a77896a Update ui_looking_glass_app.hpp
size of db is uint8_t, adjusting live-v and peak-v array to uint8_t
2023-04-11 20:41:42 +02:00
eried 99c26c3b7b Adding step files of the enclosure 2023-04-11 09:55:21 +02:00
Brumi-2021 aa20bff2b9 Merge pull request #887 from gullradriel/looking-glass-fix
Peak view entry menu and functionnalities
2023-04-10 23:10:19 +02:00
GullCode f5e949047d correct clear size in peak-v and live-v 2023-04-10 21:39:50 +02:00
GullCode afb75af5b1 removed redundant set_dirty 2023-04-09 22:32:35 +02:00
GullCode 7f99b1181e Added MAX:FREQ , RST , JMP on LIVE-V and PEAK-V. Ploter is having a y shift in these modes 2023-04-09 22:07:50 +02:00
GullCode cec0fe3288 Peak view entry menu and functionnalities 2023-04-09 14:45:07 +02:00
gullradriel ba3114c0b6 Update ui_looking_glass_app.cpp
Restoring accidentally deleted filter_config.on_change
2023-04-09 08:26:09 +02:00
gullradriel cc2bb772e5 Merge pull request #884 from gullradriel/looking-glass-level-view-controls
Looking glass level view controls
2023-04-07 17:02:32 +02:00
GullCode fbf9138410 live frequency view integration controls 2023-04-07 17:01:09 +02:00
GullCode 0559aa2037 Merge branch 'next' of github.com:gullradriel/portapack-mayhem into next 2023-04-07 15:30:51 +02:00
gullradriel 0d7072ec5d Merge pull request #882 from bernd-herzog/fix_hackrf_mode_2
fixed hackrf mode for portapacks with TQFP100 CPLD
2023-04-07 14:54:33 +02:00
GullCode c1f55c0dec Merge branch 'next' of github.com:gullradriel/portapack-mayhem into next 2023-04-07 13:45:18 +02:00
gullradriel 464b7dd98d Update analog_audio_app.hpp
Added 100k bandwidth choice for SPEC
2023-04-07 13:44:48 +02:00
GullCode 4d429437b5 Revert "Update analog_audio_app.hpp"
This reverts commit bc39292e72.
2023-04-07 13:43:43 +02:00
gullradriel bc39292e72 Update analog_audio_app.hpp
Added 100k bandwidth choice for SPEC
2023-04-07 13:40:16 +02:00
gullradriel 27f70cb9fe Merge pull request #880 from gullradriel/looking-test
Looking glass minor upgrade
2023-04-07 13:10:13 +02:00
Bernd Herzog e5f80adeb7 Merge pull request #881 from eried/revert-878-fix_hackrf_mode
Revert "fixed hackrf mode for portapacks with TQFP100 CPLD"
2023-04-07 12:54:47 +02:00
Bernd Herzog 5a6f6e8db0 Revert "fixed hackrf mode for portapacks with TQFP100 CPLD" 2023-04-07 12:53:26 +02:00
Bernd Herzog 21547e6c55 fixed hackrf mode for portapacks with TQFP100 CPLD 2023-04-07 12:52:41 +02:00
GullCode 12cfbf70f0 added option button for view_config, default to SPCTR (spectrum), clear screen between changes, color gradient 2023-04-07 11:30:28 +02:00
GullCode c3971cae32 Added live frequency view mode 2023-04-07 01:57:42 +02:00
gullradriel f7c2dde79f Merge pull request #878 from bernd-herzog/fix_hackrf_mode
fixed hackrf mode for portapacks with TQFP100 CPLD
2023-04-06 17:29:28 +02:00
Bernd Herzog cd2d810c31 fixed hackrf mode for portapacks with TQFP100 CPLD 2023-04-06 14:09:50 +02:00
jLynx ba6202e651 Merge pull request #874 from NotherNgineer/next
TPMS app enhancement to support Celsius/Fahrenheit toggling #873
2023-04-06 08:25:32 +12:00
Mark Thompson 40d64030c8 Enhance TPMS app to support Fahrenheit temperature
Modified TPMS app to allow switching between Celsius & Fahrenheit temperatures, which also simplified some of the code by sticking with a constant heading row
2023-04-05 14:16:44 -05:00
Mark Thompson 049a20b878 Enhance TPMS app to show Fahrenheit temps
Modified TPMS app to allow switching between Celsius & Fahrenheit temperatures, which also simplifies some of the code
2023-04-05 14:13:16 -05:00
gullradriel 0e5ae7a6a4 Merge pull request #871 from Brumi-2021/Add_tick_box_sel_common_RX_TX_freq_to_MIC_APP
Add Separated/common freq control in Mic App
2023-04-04 18:53:43 +02:00
Brumi-2021 c867f98117 Add Separated/common freq control in Mic App 2023-04-04 17:26:45 +02:00
gullradriel 54eebedc1f Merge pull request #869 from NotherNgineer/next
#868 TPMS app displays incorrect readings for Type 5 sensors
2023-04-04 07:37:05 +02:00
Mark Thompson 35db368527 Update tpms_packet.cpp 2023-04-03 16:40:07 -05:00
Mark Thompson be691fd278 Fixed TPMS type 5 sensor readings
Fixed issue with temperature & pressure values for OOK-8400-Schrader TPMS sensor type 5 (temperature & pressure were swapped and using wrong conversion ratio).  Tested fix against 14 sensors of this type.
2023-04-03 15:36:10 -05:00
gullradriel 3db3e78b44 Merge pull request #866 from gullradriel/recon-gui-update
Recon gui update
2023-04-03 12:49:22 +02:00
GullCode a48ecccd7d widget size and position adjustement to avoid overlap, changed OPT in favor of CONFIG and gave all the side buttons the same size 2023-04-03 12:46:59 +02:00
GullCode 570775552c fixed peak that was drawing after the rssi widget 2023-04-03 12:45:35 +02:00
gullradriel ecbb232d9c Merge pull request #864 from bernd-herzog/ssd_to_usb
Ssd to usb
2023-04-01 19:58:02 +02:00
gullradriel 0e59e61461 Merge pull request #865 from gullradriel/recon-fix
fixing range frequencies and index skipping
2023-04-01 19:57:31 +02:00
GullCode 7da322f926 fixing range frequencies and index skipping 2023-04-01 19:56:44 +02:00
Bernd Herzog 04392752d1 fixed spelling error 2023-04-01 19:38:38 +02:00
Bernd Herzog db5fcaba44 Merge remote-tracking branch 'origin/next' into ssd_to_usb 2023-04-01 19:24:53 +02:00
Bernd Herzog a8f0c8eac9 refactoring 2023-04-01 19:24:13 +02:00
Bernd Herzog 6fadd70c1d updated ui 2023-04-01 19:16:01 +02:00
Bernd Herzog 8d8d457da2 refactoring 2023-04-01 18:57:53 +02:00
Bernd Herzog 893df7272f refactoring 2023-04-01 18:36:57 +02:00
Bernd Herzog bb90fdc5fc Implemented write 2023-04-01 17:39:08 +02:00
Bernd Herzog 50859171f4 implemented msd read 2023-04-01 17:21:57 +02:00
Bernd Herzog fc1b676ce6 implemented rest of scsi stack 2023-03-31 22:34:55 +02:00
Bernd Herzog 776ac652a8 implemented scsi inquiry 2023-03-31 19:18:39 +02:00
gullradriel c9c438824d Merge pull request #860 from gullradriel/load-save-persistent-memory
Load save persistent memory
2023-03-31 18:25:10 +02:00
GullCode 95eb1e6d59 Loading pmem if enable before displaying splashscreen 2023-03-31 14:24:54 +02:00
GullCode 1f32367495 reset to original since loading is now taking place in navigation 2023-03-31 14:24:29 +02:00
GullCode 0ed5e6542e P.Mem settings menu entry 2023-03-31 14:06:22 +02:00
GullCode 7240d45a4f added on green sdcard load persistent settings 2023-03-31 14:05:49 +02:00
GullCode 17250304e0 indentation & added load & save persistent settings to sdcard 2023-03-31 14:05:33 +02:00
GullCode 835bc49999 Working pmem load flag checkbox 2023-03-30 17:40:17 +02:00
Bernd Herzog a6eb430830 integrated usb stack 2023-03-30 11:46:36 +02:00
Bernd Herzog 8dd68a0811 added copy of hackrf usb stack 2023-03-29 17:05:11 +02:00
Erwin Ried 9540776afd Merge pull request #855 from bernd-herzog/flash_utility
Add new App: flash utility
2023-03-28 15:41:43 +02:00
Bernd Herzog f5d4fce945 added flash utility 2023-03-28 14:39:00 +02:00
gullradriel 8840a6e894 Merge pull request #844 from bernd-herzog/reduce_image_size_lz4
Reduce image size lz4
2023-03-28 07:35:51 +02:00
gullradriel 7ef98f7741 Merge pull request #854 from gullradriel/converter-fix-disable
Fix to force converter icon to be displayed if enabled
2023-03-27 23:06:32 +02:00
GullCode b41be47c9d pesky and non consistent indentation is boring 2023-03-27 23:05:46 +02:00
GullCode 1e2bc703b8 Fix to force converter icon to be displayed if enabled 2023-03-27 23:03:09 +02:00
Bernd Herzog 9115eadd17 added lz4 to dockerfile 2023-03-27 16:22:20 +02:00
gullradriel 05429d3d15 Merge pull request #853 from gullradriel/up-down-convert
Up Down Converter (replacement/update of previous HamItUp function)
2023-03-27 15:39:04 +02:00
GullCode 30c1f9f594 Changed hamitup to converter icons and functions 2023-03-27 14:22:35 +02:00
GullCode f994f8d697 changing logic to take 'up' or 'down' in account 2023-03-27 14:22:07 +02:00
GullCode e045628dab Menu entry for Converter, cleanings of Radio menu 2023-03-27 14:16:03 +02:00
GullCode 17cdb34fea added set of functions for up/down/enable/disable converter 2023-03-27 14:15:28 +02:00
GullCode 9df0f6e9df updated bitmap icons for converter 2023-03-27 14:14:53 +02:00
GullCode 54e4b535cc converters icons 2023-03-27 14:14:11 +02:00
gullradriel d6555a7af0 Merge pull request #852 from gullradriel/recon-minor-update
Recon minor update
2023-03-26 21:06:16 +02:00
GullCode 30004a1c3c cosmetic, ui moves 2023-03-26 21:04:43 +02:00
GullCode 8d60da0a5a updated description of entry / input output file 2023-03-26 15:30:54 +02:00
GullCode 17f30b6f26 Added and fixed go to index 2023-03-26 15:11:27 +02:00
GullCode 3d13ee828e changed text index to button, adding set to index and on_encoder, global indentation 2023-03-24 23:44:16 +01:00
Brumi-2021 9398b12093 Merge pull request #850 from KillerTurtleSoftware/patch-1
Corrected tone_key.cpp Motorola Code
2023-03-24 16:53:37 +01:00
Erwin Ried 61b82645f7 Update problem-upgrading-the-firmware.md 2023-03-24 12:50:54 +01:00
Erwin Ried c285084dcd Update bug_report.md 2023-03-24 12:49:18 +01:00
KillerTurtleSoftware e034c6e66e Corrected tone_key.cpp Motorola Code
Corrected Motorola Code on a few freqs.
2023-03-23 08:46:01 -05:00
gullradriel bb3ba29d22 Merge pull request #849 from gullradriel/level-rssi-minor-fix
Level rssi minor fix
2023-03-23 13:35:04 +01:00
GullCode ad11ab649e Changed default RSSI peak value 2023-03-23 13:34:15 +01:00
GullCode c76c6bd857 Changed default RSSI peak value, position and size of RSSI graph 2023-03-23 13:33:59 +01:00
GullCode 47b770bc3a Changed RSSIGraph drawing system 2023-03-23 13:33:22 +01:00
gullradriel dd8538b8bf Merge pull request #848 from gullradriel/rssi-peak-level-tune
Rssi peak level tune
2023-03-22 14:40:21 +01:00
GullCode 03c9b4aba7 fixed horizontal peak hold, adjusted horizontal and vertical size 2023-03-22 14:38:47 +01:00
GullCode 56526a5710 enabled 1s peak hold on rssi view 2023-03-22 14:38:00 +01:00
GullCode 2d9fe6cf8a Set 1s peak as default, set 32x resolution as default 2023-03-22 14:37:31 +01:00
gullradriel 4ec444688f Merge pull request #846 from gullradriel/audio_app_freq_fix
forcing input freq to be set in all cases
2023-03-22 11:42:15 +01:00
GullCode 2e4a86d7ec forcing input freq to be set in all cases 2023-03-22 11:39:00 +01:00
gullradriel 92b622deac Added HamItUp option (#840)
* Added HamItUp option to allow quick offset of the tuned frequency
* New HamItUp icon for top bar
* HamItUp checkbox status and frequency persistent settings in Settings/Radio
2023-03-22 08:46:58 +01:00
gullradriel 2457ba016f Merge pull request #845 from gullradriel/app-settings-update
Quoted restore frequency at start for audio app
2023-03-22 08:44:01 +01:00
GullCode 4a6c76cc47 Quoted restore frequency at start for a good interactions with other apps calling audio app 2023-03-21 22:45:49 +01:00
Bernd Herzog 7b4662fe4a fixed packing 2023-03-21 22:01:09 +01:00
Bernd Herzog 8fcedb017c fixed script 2023-03-21 21:31:59 +01:00
Bernd Herzog 7b3ab64930 fixed data packing 2023-03-21 21:27:32 +01:00
Bernd Herzog b856b047cc added compression of baseband images 2023-03-21 19:18:38 +01:00
gullradriel ce23c7d882 Merge pull request #841 from gullradriel/looking-glass-update
fixing width too tiny for calculation. It has to be a multiple of 240
2023-03-20 16:45:33 +01:00
GullCode 7eba8fd49b fixing width too tiny for calculation. It has to be a multiple of 240 2023-03-20 16:43:31 +01:00
gullradriel bfdf7660b6 Merge pull request #838 from bernd-herzog/error_handling
improved runtime error details in guru meditation
2023-03-19 08:40:25 +01:00
Bernd Herzog b83f43793c improved runtime error handling 2023-03-18 23:19:23 +01:00
Bernd Herzog ed1c2e1c03 Merge remote-tracking branch 'origin/next' into error_handling 2023-03-18 19:35:22 +01:00
Bernd Herzog caba16a549 Merge remote-tracking branch 'origin/next' into error_handling 2023-03-18 16:39:56 +01:00
gullradriel 5318542021 Merge pull request #836 from gullradriel/looking-glass-update
Looking glass update
2023-03-16 17:41:22 +01:00
GullCode 93f966bdcd Fixing 20MHz boudaries 2023-03-16 12:09:13 +01:00
GullCode 7b5f138dfb Fixing max<min case 2023-03-16 12:03:00 +01:00
GullCode 149cd755ca Restoring min step of 1, forcing 20Mhz minimum wide view 2023-03-16 11:56:24 +01:00
GullCode 63d0201b71 Fixing set freq and min step value 2023-03-16 11:32:26 +01:00
GullCode cf19408784 Merge branch 'next' of github.com:gullradriel/portapack-mayhem into looking-glass-update 2023-03-16 10:40:11 +01:00
gullradriel f882de5eff Merge pull request #835 from gullradriel/recon-update
Recon update
2023-03-16 10:36:24 +01:00
GullCode 49bda24079 added steps config and thus possibility to adjust config / see under 240 MHz 2023-03-16 10:33:36 +01:00
GullCode a1705dd9d4 reoganised things a little, added nb_columns management in ui 2023-03-14 22:23:16 +01:00
GullCode 155543e5d5 Added nb_columns, changed drawing due to column system 2023-03-14 22:22:49 +01:00
gullradriel 62b9fa2b6a Merge pull request #834 from gullradriel/recon-update
Recon minor update, RSSI widget get 'on touch'
2023-03-14 00:28:22 +01:00
GullCode f5427d7fdc UI adjustements 2023-03-14 00:26:25 +01:00
GullCode b8c1e8c4a6 Added on_touch on RSSI widget 2023-03-14 00:26:12 +01:00
gullradriel 7a0d02cb83 Merge pull request #833 from gullradriel/recon-update
Recon minor update
2023-03-13 23:29:37 +01:00
gullradriel c23f03c074 Merge branch 'eried:next' into recon-update 2023-03-13 23:27:44 +01:00
GullCode cfdd12d8a6 aligned OPT to the right 2023-03-13 23:27:04 +01:00
gullradriel d1ab93f644 Merge pull request #832 from gullradriel/recon-update
Recon update
2023-03-13 23:18:26 +01:00
GullCode f7df4f3575 Use rssi focusable, added shortcut to level app, glass app, cut buttons a bit better in the ui, better pause/resume/skiplock/unlock button 2023-03-13 23:14:06 +01:00
GullCode ad4cfe5a44 adding header guard 2023-03-13 23:12:46 +01:00
GullCode 8db44d1a92 fixed a text size, used new rssi focusable property so you can launch the level app by touching or selecting and clicking the rssi bars 2023-03-13 22:56:47 +01:00
GullCode 37cfcb0d5c added focusable ability to rssi field 2023-03-13 22:55:48 +01:00
gullradriel 6a61b9528e Merge pull request #831 from gullradriel/level-app-updates
Level app updates
2023-03-13 15:59:24 +01:00
gullradriel ab58f368b5 Merge branch 'eried:next' into level-app-updates 2023-03-13 15:56:41 +01:00
gullradriel 023ee2a6f5 Merge pull request #830 from bernd-herzog/error_handling
added runtime error details to guru meditation
2023-03-13 15:50:27 +01:00
Bernd Herzog b6011a777b added runtime error details to guru meditation 2023-03-13 15:04:00 +01:00
GullCode 37494500b2 Added display of rssi get delta, swapped audio and steps button for convenience 2023-03-13 14:04:23 +01:00
GullCode f42812c6b4 Added rssi get_delta, better rssi min graph view 2023-03-13 14:03:37 +01:00
GullCode a7acb37a56 added 0.1 and 1Khz steps 2023-03-13 14:02:29 +01:00
gullradriel 69df16d6e2 Level meter (#827)
* added possibility to scale vertically from bottom to top

* Squeleton of Level app from Recon App

* Working LevelApp

* Tweaking peak and display or RSSI chart

* Moved widgets, prepared audio decode, added working ctcss display and peak hold max rssi val

* Added RSSIGraph

* Updated Level to use RSSIGraph

* Graph as lines instead as bars

* correct CTCSS hiding if not in NFM mode

* added back db value and drawing for it. clamped to [-100,20] db

* added back audio, volume, better placement for buttons, db graph

* Using different icon for Level app, unless someone provide a better one

* fixed CTCSS position

---------

Co-authored-by: GullCode <gullradriel@hotmail.com>
2023-03-10 14:25:38 +01:00
gullradriel e2620f1a33 Merge pull request #822 from heurist1/fix-tuning-radio-when-opening-app-with-settings
Fix  the initialisation of frquency when apps are launched
2023-03-05 20:57:54 +01:00
heurist1 f6a4cc26ee Move where on_change for the frequency field is setup, so that the frequency is correctly initialised when the app is launched and settings are being used 2023-03-05 19:50:56 +00:00
gullradriel 3d248647c9 Set usable persistent memory defaults for Recon (#820)
* Set usable defaults for Recon when PortaPack is not having a valid button battery installed

* fixed indentation

* fixed indentation

---------

Co-authored-by: GullCode <gullradriel@hotmail.com>
2023-03-04 22:04:53 +01:00
gullradriel 3c13161273 Merge pull request #818 from Brumi-2021/ADSB_squawk_investigation
Correct squawk id in ADSB TX
2023-03-04 08:10:43 +01:00
gullradriel f0b4914186 Merge pull request #819 from Brumi-2021/revert_new_spectrum_colour_scheme
Revert "New spectrum color scheme"
2023-03-04 08:09:44 +01:00
Brumi-2021 037fc098ef Revert "New spectrum color scheme"
This reverts commit f59437cf71.
2023-03-04 00:47:40 +01:00
Brumi-2021 988404df9c Correct squawk id in ADSB TX 2023-03-03 23:10:58 +01:00
jLynx f5deae56cf Merge pull request #806 from nnesetto/next
New Docker and sounds
2023-03-02 08:12:13 +13:00
gullradriel e526061d13 Merge pull request #815 from heurist1/adsb-multiple-aircraft-on-map2
ADSB RX multiple aircraft on map - 2
2023-03-01 18:41:25 +01:00
heurist1 daf63de55f Final corrections to make merged code compile, and reduce the adding and removing of other markers 2023-02-28 23:00:51 +00:00
heurist1 778111d466 Updates to put the multiple aircraft on the map
Also manage the CPU in on the one second tick to keep GUI responsive
Some other small edits that fix minor problems from my previous checkins
2023-02-28 20:19:23 +00:00
heurist1 00b75eacda Update map to allow multiple markers 2023-02-28 20:14:15 +00:00
heurist1 ef151e243b Imprment string trimr to remove spaces at the end of aircraft name.
(cherry picked from commit 70fd4039938cdd45f03d541e0aff1238de85fb3e)
2023-02-28 20:00:56 +00:00
heurist1 567fee1d98 Create optimised integer functions to reduce CPU usage
(cherry picked from commit a47bfe1da7bffe9f752e4c522e11593cce6dffd0)
2023-02-28 20:00:39 +00:00
heurist1 b549d3a4f1 Add ability to draw text with a transparent background
(cherry picked from commit a15da2e136147b31ab53058871815c8eb759576a)
2023-02-28 20:00:05 +00:00
gullradriel 86203f090f Merge pull request #812 from euquiq/mayhem-version
Looking Glass optimizations
2023-02-28 08:03:06 +01:00
euquiq 19fed78b7f Looking Glass optimizations 2023-02-27 23:29:13 -03:00
ittercho c0532aeafa Merge branch 'eried:next' into next 2023-02-22 23:24:38 +00:00
Erwin Ried c8774e82d9 Merge pull request #808 from zxkmm/next
Add config files for FREQMAN
2023-02-22 14:07:27 +01:00
zxkmm 62ee23a314 Add config files for FREQMAN 2023-02-22 21:00:15 +08:00
ittercho 70551ef155 Format 2023-02-19 08:35:25 +01:00
ittercho 91074e5b4e Add file 2023-02-19 08:35:19 +01:00
gullradriel 5f95cec5f4 Merge pull request #805 from phil-stumpy/next
Adding support for HackRF One R9
2023-02-16 13:48:01 +01:00
phil-stumpy 66ba6442b1 Adding support for HackRF One R9, as per https://github.com/sharebrained/portapack-hackrf/pull/187 2023-02-16 12:10:26 +00:00
gullradriel 7e20cea6d7 Merge pull request #800 from gullradriel/next
Updated hackRF submodule
2023-02-07 14:00:54 +01:00
GullCode 65217856c0 Updated hackRF submodule 2023-02-07 13:59:00 +01:00
gullradriel 5117538b49 Merge pull request #799 from lujji/fix-ook-app
Fix OOK app
2023-02-04 16:41:06 +01:00
lujji 362c208078 fix ook app and 1527 encoder; add scan encoding 2023-02-02 17:54:36 +02:00
Erwin Ried 4f9e8e9642 Update README.md 2023-01-25 15:34:09 +01:00
Erwin Ried de53626a46 Update README.md 2023-01-25 15:33:00 +01:00
Erwin Ried 2cf6849985 Update README.md 2023-01-25 15:16:03 +01:00
Erwin Ried 1cde3ab189 Update README.md 2023-01-25 15:12:21 +01:00
Erwin Ried bdb70a3231 Update README.md 2023-01-25 15:04:43 +01:00
Erwin Ried 49e63e2728 Update README.md 2023-01-25 14:36:18 +01:00
Erwin Ried 1beca57e56 Update README.md 2023-01-25 14:33:27 +01:00
Erwin Ried 27632825a3 Update contributors list 2023-01-25 14:14:12 +01:00
gullradriel e02e58b366 Merge pull request #789 from formtapez/settings
Save and recall all receiver settings of the Audio RX app
2023-01-21 13:04:52 +01:00
formtapez 37912df085 tabs vs spaces 2023-01-21 11:46:43 +01:00
formtapez a20a08c630 save/recall all receiver settings 2023-01-21 11:36:06 +01:00
formtapez a8885282cd save and recall stepsize 2023-01-20 22:21:59 +01:00
gullradriel 2d9090862b Merge pull request #782 from Brumi-2021/adding_Vertical_rate_field_ADSB_TX
Added Vertical rate field ADSB-TX
2023-01-05 09:59:00 +01:00
Brumi-2021 6e5bb7911c Added Vertical rate field ADSB-TX 2023-01-05 00:14:11 +01:00
Brumi-2021 46f98ddc8b Merge pull request #780 from Brumi-2021/Correcting_complementary_Bearing_Compas_Hdg_angle_ADSB-TX_App_final
Solving correct  Bearing Angle in ADSB TX app
2023-01-01 23:15:52 +01:00
Brumi-2021 2902365b80 Solving correct Bearing Angle in ADSB TX app 2023-01-01 23:23:06 +01:00
Brumi-2021 c0f368c978 Merge pull request #775 from Brumi-2021/Small_BW_Label_error_correction_Scanner_App
Scanner BW label corrections
2022-12-29 23:23:41 +01:00
Brumi-2021 75c2b69f19 Scanner BW label corrections 2022-12-30 00:38:54 +01:00
Brumi-2021 3291c7e2a0 Merge pull request #774 from Brumi-2021/Minor_ADSB_Compas_sinf32_array_value_correction_and_comments
Minor sin_f32_table correction and comments
2022-12-29 22:24:28 +01:00
Brumi-2021 64ca9f6a68 Minor sin_f32_table correction and comments 2022-12-29 23:27:15 +01:00
gullradriel 297063873f Merge pull request #767 from rusty-labs/scanner-manual-mode-unlimited-range
#765 Scanner app, unlimited range for manual mode
2022-12-29 17:41:00 +01:00
jLynx 2a38f386ab Update version.txt 2022-12-29 15:35:54 +13:00
jLynx 079a0506a4 Update past_version.txt 2022-12-29 15:35:45 +13:00
Brumi-2021 e8ad86cc94 Merge pull request #768 from rusty-labs/sin_function_180_fix
#755 fix, sin_f32 fails at 180
2022-12-28 16:34:38 +01:00
rusty.labs e69c9bbc7b #755 fix, sin_f32 fails at 180
#755 fix, sin_f32 returns incorrect result at 180 degrees, clean up
2022-12-28 01:13:42 -05:00
rusty.labs 1f7b800c2a #765 unlimited range for manual mode
* fix for #765, manual mode has unlimited range now
* speedup for button_add.on_select (roughly x70 times faster)
* fix for random freezes while switching to Audio
2022-12-26 17:18:30 -05:00
Brumi-2021 25c267a3d9 Merge pull request #744 from strijar/spectrum_color
New spectrum color scheme Look at table (LUT) for the Waterfall FFT .
2022-12-17 16:02:54 +01:00
gullradriel efbcd2aa9b Merge pull request #752 from lujji/fix-ook-bug
Fix OOK repeat bug
2022-12-17 12:44:19 +01:00
gullradriel f32b55f66f Merge pull request #754 from lujji/ook-scan
Implement OOK scan
2022-12-17 12:43:34 +01:00
gullradriel e9adc32421 Merge pull request #757 from gullradriel/next
Updated submodules
2022-12-14 22:18:43 +01:00
GullCode a120a6344d Updated submodules 2022-12-14 22:17:25 +01:00
lujji e3cea4c68b minor ui fix 2022-12-05 22:12:46 +02:00
lujji 0631f5d5ab implement ook scan 2022-12-05 16:51:23 +02:00
lujji 8986b65f94 fix ook repeat bug 2022-11-30 10:59:24 +02:00
gullradriel 7f64606fb2 Merge pull request #750 from gullradriel/recon-delete-retune-fix
Retune after delete fix
2022-11-20 20:14:47 +01:00
GullCode 7bfb54eee9 better order of events 2022-11-20 19:53:03 +01:00
GullCode e0c1f7b45e Retune after delete fix 2022-11-20 19:46:01 +01:00
gullradriel 734f315266 Merge pull request #749 from gullradriel/updating-am-mode
Added/Renamed AM bandwidth modes
2022-11-20 18:36:43 +01:00
GullCode 7f6aebbe53 Fixed typos 2022-11-20 18:29:20 +01:00
GullCode 5f62926af3 Fixed typo 2022-11-20 18:02:54 +01:00
GullCode 17f6475506 Added/Renamed AM bandwidth modes 2022-11-20 17:44:11 +01:00
Jimi Sanchez 17d3cb387e Merge pull request #747 from Brumi-2021/“Additional_AM_BW_type_9Khz_on_top_current_6Khz”
“additional am bw type 9 khz on top current 6 khz”
2022-11-19 17:04:19 -05:00
Brumi-2021 1e4c93b979 Final opt. AM-9K, applied to Audio_RX and Mic App. 2022-11-19 18:17:54 +01:00
Brumi-2021 25dfa96257 Adding FIR_taps for EU AM broadcasting 9K00A3E 2022-11-14 00:32:29 +01:00
Erwin Ried 400cccdcc1 Contributors gridview 2022-11-10 09:41:20 +01:00
Belousov Oleg f59437cf71 New spectrum color scheme 2022-11-10 02:17:04 +03:00
GullCode 5577ec82ed Merge pull request #729 from BehleZebub/patch-1
Update generate_world_map.bin.py
2022-11-02 17:54:42 +01:00
GullCode da98e7739e Update generate_world_map.bin.py
Formatting text
2022-11-02 17:21:56 +01:00
GullCode b5b5bf42af Merge pull request #737 from BehleZebub/next
update for python scripts so no python2.7 is needed
2022-11-02 17:14:53 +01:00
BehleZebub 587fbfbbb1 added shebang line for pyhton3 on unix 2022-11-02 00:36:04 +01:00
GullCode c54e382db2 Merge pull request #739 from lujji/next
Add gain and amplifier controls in Jammer
2022-11-01 12:00:55 +01:00
lujji 22de89c879 added gain and amp controls 2022-11-01 06:42:55 +02:00
GullCode aa778e5797 Merge pull request #738 from Brumi-2021/Extending_previous_ghost_signal_interference_c/m_in_all_RX_after_using_Replay_App
(MINOR IMPROV Replay App) - Extending previous  "ghost interf. signal" c/m to Replay App
2022-10-30 20:15:24 +01:00
Brumi-2021 e8e98475e2 Extending "ghost interf. signal" c/m to Replay App 2022-10-30 19:23:52 +01:00
BehleZebub 95d1bca9fd changed from python2 to python3 2022-10-30 00:04:31 +02:00
BehleZebub 1a5c360efe changed from python2 to python3 2022-10-30 00:04:07 +02:00
BehleZebub 560c7143bf Update make_dcs.py 2022-10-30 00:03:07 +02:00
BehleZebub 6fc03a2651 changed from python2 to python3 2022-10-30 00:02:01 +02:00
BehleZebub f31ee1172d changed from python2 to python3 2022-10-30 00:00:55 +02:00
BehleZebub 996e648a64 changed from python2 to python3 2022-10-30 00:00:26 +02:00
BehleZebub ca4f68d24a changed from python2 to python3 2022-10-29 23:58:26 +02:00
GullCode 2c3f8e9b3d Merge pull request #734 from Brumi-2021/“Solving_correctg_RX_DSB-SC_Suppressed_Carrier”
Mic App: DSB RX distortion c/m + minor improv.
2022-10-29 21:31:50 +02:00
Brumi-2021 a591ba572f Mic App: DSB RX distortion c/m + minor improv. 2022-10-29 16:02:08 +02:00
BehleZebub c9657bc92b Update generate_world_map.bin.py
corrected typo in print();
2022-10-28 17:38:00 +02:00
BehleZebub b8d98e4f45 Update generate_world_map.bin.py
forced endianess on outfile.write() to little endian and closed outfile at the end
2022-10-22 23:42:40 +02:00
GullCode e0309b13e5 Merge pull request #728 from GullCode/fix-wfm-bw-label
Fix wfm bw label
2022-10-18 21:38:21 +02:00
GullCode c2117b2c5b cosmetic fix for bw display 2022-10-18 21:37:28 +02:00
GullCode 2b78f9e907 Correct WFM bw label to 200k 2022-10-18 21:36:22 +02:00
GullCode 6cd4eb0358 Correct WFM bandwidth and step 2022-10-18 21:26:14 +02:00
GullCode 8ec69d7c95 Merge pull request #727 from Brumi-2021/adding_in_RX_WFM_to_Mic_App
Add WFM mode in Mic App (in tx and rx)
2022-10-16 20:47:50 +02:00
Brumi-2021 efe8d82fae Add WFM mode in Mic App (in tx and rx) 2022-10-16 19:01:05 +02:00
GullCode 32697d1c73 Merge pull request #723 from GullCode/recon-freqman-steps-band-update
Recon freqman steps band update
2022-10-11 12:52:23 +02:00
GullCode 11558b9843 Merge pull request #722 from GullCode/scanner-freqman-update-max_files-steps
Scanner freqman update max files steps
2022-10-11 12:52:10 +02:00
GullCode e5d1308560 Added FM bands files 2022-10-11 12:49:32 +02:00
GullCode 62968e6009 Added default RECON.TXT file 2022-10-11 12:49:15 +02:00
GullCode a9b4abc07e Indenting some comments 2022-10-11 12:48:42 +02:00
GullCode 05f3793213 Added 30Khz steps and removed quoted code 2022-10-11 12:46:12 +02:00
GullCode ae8633c569 Use FREQMAN_MAX_PER_FILE instead of MAX_DB_ENTRY 2022-10-11 12:40:49 +02:00
GullCode 480f492740 Removed MAX_DB_ENTRY definition 2022-10-11 12:40:31 +02:00
GullCode dd2e23f901 Updated FREQMAN_MAX_PER_FILE value 2022-10-11 12:40:08 +02:00
GullCode 3ca57f634c Merge pull request #721 from eried/hackrf_update
Update hackrf
2022-10-11 12:10:26 +02:00
GullCode 29ac3192cb Update hackrf 2022-10-11 12:03:25 +02:00
GullCode e76faf6edd Merge pull request #717 from Brumi-2021/Recovered_ALC_AK4953_Mic_App_feature_solving_WM8731_side_effects
Adding Mic Control gain in both platforms : mic Auto volume Level Control  (AK4951) and mic Boost control (WM8731)
2022-10-09 21:50:43 +02:00
GullCode 5474487751 Merge pull request #696 from andrej-mk/ook
Increase max OOK clock
2022-10-09 18:23:33 +02:00
GullCode e6cf04e511 Update ui_encoders.hpp
Proper indentation
2022-10-09 18:22:23 +02:00
GullCode 1d521819ff Merge pull request #711 from GullCode/recon-app
Recon app
2022-10-08 13:46:50 +02:00
GullCode 83f7c9ae63 Merge pull request #707 from Brumi-2021/try_to_solve_RX_ghost_signal_issue_#637
Solve previous regression fw 1.3.1 -->fw 1.4.0 onwards , about RX ghost signal issue #637
2022-10-07 22:17:10 +02:00
igolyudov 310fbd53ec Update docker file (#719)
Pin base image ubuntu LTS version. add installation python3 with python3-yaml package. create python link in PATH for build hackrf dependency,
2022-10-04 08:56:04 +13:00
Brumi-2021 6b75249b0a Finalised all Mic Boost(WM) and Mic ALC(AK) 2022-10-02 00:51:12 +02:00
Brumi-2021 745574d3c4 Ak4951-ALC_base adding WM8731-boost OFF options 2022-09-28 22:42:33 +02:00
Jimi Sanchez c80595db7e Merge pull request #535 from jimilinuxguy/jimi-merging-conflicts
Playlist replay application
2022-09-19 17:48:11 -04:00
Jimi Sanchez 040dded2a6 Merges latest firmware into feature branch 2022-09-19 17:35:28 -04:00
Jimi Sanchez 958c9a1bfa Merge pull request #4 from jimilinuxguy/replayapp
Replayapp
2022-09-19 13:13:21 -04:00
Jimi Sanchez 76a137924c Merge pull request #3 from eried/master
Master
2022-09-19 13:12:31 -04:00
Jimi Sanchez 861db600e8 Merge branch 'replayapp' into master 2022-09-19 13:12:15 -04:00
Erwin Ried 4993a6abcb Update README.md 2022-09-16 09:28:32 +02:00
GullCode 9086f32a63 Added Recon app persistent settings 2022-09-13 23:58:03 +02:00
GullCode 9d59c07855 Added Recon app under 'Receive' menu 2022-09-13 23:58:03 +02:00
GullCode 0d18aa47f3 Added Recon files to CMake list 2022-09-13 23:58:03 +02:00
GullCode cf40f5eb14 Added ButtonWithEncoder 2022-09-13 23:58:03 +02:00
GullCode fe4bc7902f Added access to min/med/max values 2022-09-13 23:58:03 +02:00
GullCode 5d5865eefb Added tone to string and string to tone 2022-09-13 23:58:03 +02:00
GullCode a7370ee95d Added new file format funcs 2022-09-13 23:58:03 +02:00
GullCode 223cd7c20d added Recon files 2022-09-13 23:58:03 +02:00
Erwin Ried 1be3167748 Merge pull request #710 from Brumi-2021/Increase_freq_step_resolution
Very minor change , add 10 & 50Hz freq. steps , SSB  in HF and Qo-100_sat_#669
2022-09-12 09:24:25 +02:00
Brumi-2021 1bbd889005 Very minor change , add 10/50Hz freq. step #669 2022-09-06 21:01:09 +02:00
Erwin Ried d87e9853a1 Merge pull request #705 from Brumi-2021/Bias_DC_Voltage_not_working_in_TPMS_&_ERT_#700
Adding Bias dc voltage not working in tpms & ert (previous issue #700)
2022-09-05 10:14:47 +02:00
Erwin Ried 36109964a7 Merge pull request #701 from arneluehrs/ais-fix
AIS Class B decoding and display
2022-09-05 10:13:54 +02:00
Brumi-2021 6087c658e9 Applied ghost-signal c/m to all remaining TX Apps 2022-08-27 17:47:24 +02:00
Brumi-2021 08a108d3e4 First test, ghost-singal c/m to only Mic_App 2022-08-26 18:34:30 +02:00
GullCode c78659db38 RECON sdcard dir and empty config 2022-08-24 17:36:58 +02:00
Brumi-2021 5021a03572 Minor change radio,disable-->receiver.disable 2022-08-23 00:04:48 +02:00
Brumi-2021 961a4c4588 Addition_bias_DC_ERP_TPMS 2022-08-21 19:59:15 +02:00
Arne Luehrs a89d418202 AIS Decoding, destination text display fix
Remove trailing null characters '@' from display of destination field
2022-08-15 14:41:07 +08:00
Arne Luehrs 1dcc80ba59 Merge remote-tracking branch 'refs/remotes/origin/ais-fix' into ais-fix 2022-08-15 14:04:40 +08:00
Arne Luehrs 1e14ca4df1 Enable AIS-B decoding and display
Implement decoding for AIS messages 18 and 24A 24B
clean up display of text messages by removing the trailing null
character '@'
2022-08-15 13:56:40 +08:00
Arne Luehrs 5096f91986 Add AIS Class B Decoding 2022-08-15 00:12:24 +08:00
Arne Luehrs 65be02c5b1 Add AIS Class B Decoding 2022-08-14 23:48:04 +08:00
Arne Luehrs f5a604a0a5 Merge pull request #3 from eried/next
Sync with upstream
2022-08-12 15:17:29 +08:00
andrej 87418703e0 Make clk and frame duration steps in OOK configurable 2022-08-01 08:40:26 +02:00
andrej e33c98cbc7 Increase maximum OOK clock to 1000 kHz 2022-08-01 08:40:16 +02:00
Brumi-2021 823c69eb42 Merge branch 'eried:next' into next 2022-06-14 21:55:36 +02:00
jLynx 15f3d81798 Update version.txt 2022-06-08 19:21:01 +12:00
jLynx fa2791004f Update past_version.txt 2022-06-08 19:20:52 +12:00
Timo Taskinen 50bd08d9ff Fix AM bandwidth and sampling rate in scanner (#671)
In scanner app, the bandwidth and sampling rate for AM modulation was incorrect. This resulted in high pitched and distorted sound. I have now copied the settings from the Audio receiver app, and now the sound in Scanner sounds good also in AM mode.
2022-06-07 11:05:17 +12:00
Brumi-2021 a26ee84ff8 Merge branch 'eried:next' into next 2022-06-06 15:33:20 +02:00
jLynx 39134b62c3 Fix for new H2+ devices (#666)
* WIP Fix for new h2+ devices

* reset

* Updated sub module
2022-06-05 14:15:44 +12:00
Jared Boone e5a30b4309 Persistent memory check value verification, defaulting when fails. (#662)
* Make default constructor for touch calibration

* Add persistent memory check value and access abstraction.

* Add persistent data_t default constructor with reasonable defaults.

* serial_format_t default constructor.

* Tidy up backlight timeout type.

* Add persistent data struct version/checking.

* Make range_t functions constexpr.

* Move ui_config and functions into class.

* Add backlight_config_t struct, separate enable and time settings.
2022-05-29 08:55:18 +12:00
Brumi-2021 379ad6dbf0 Recovered_ALC_Mic_Feature_AK4953_OK_WM8731 2022-05-28 22:29:10 +02:00
Brumi-2021 840da4c685 Merge branch 'eried:next' into next 2022-05-22 16:41:48 +02:00
ArjanOnwezen 2031a79b34 Update problem-upgrading-the-firmware.md
Typo
2022-05-21 10:12:52 +02:00
ArjanOnwezen deff646e36 Update problem-upgrading-the-firmware.md
Typo
2022-05-21 10:11:36 +02:00
jLynx 4aa3314906 Updated templates (#655)
* Update problem-upgrading-the-firmware.md

* Update problem-upgrading-the-firmware.md

* Update bug_report.md
2022-05-21 13:41:44 +12:00
jLynx e3da9d4cb2 Included DLL files (#654) 2022-05-21 12:11:03 +12:00
jLynx c389ce7c0e Merge pull request #653 from eried/next
v1.5.3
2022-05-21 12:06:39 +12:00
jLynx 2f10fe2fe4 v1.5.3 (#649)
* Update create_stable_release.yml

* Update version.txt
2022-05-21 08:03:17 +12:00
jLynx 5a7b12f920 Update version.txt 2022-05-20 11:00:41 +12:00
jLynx f8a4134973 Update past_version.txt 2022-05-20 11:00:34 +12:00
ArjanOnwezen a3ee160e27 Merge pull request #643 from ArjanOnwezen/save-more-app-settings
Save most common settings for TX apps
2022-05-13 21:42:51 +02:00
Arjan Onwezen ade0d6c68f French translations. 2022-05-13 09:31:58 -04:00
ArjanOnwezen 8e9355b57a Merge pull request #644 from ArjanOnwezen/set-fixed-modulation-for-pocsag
Set fixed modulation (NFM) for Pocsag app. (#569)
2022-05-13 15:11:43 +02:00
Arjan Onwezen e97ffd42ef Set fixed modulation (WFM) for Pocsag app. 2022-05-13 09:04:53 -04:00
Arjan Onwezen cccc92cc34 Save most common settings for TX apps. And translated some French apps along the way. 2022-05-13 08:38:04 -04:00
ArjanOnwezen 3387b59eab Add AMD64 folder #632
Added AMD64 folder #632
2022-05-11 17:33:33 +02:00
MattLodge 6c5f8a38e0 Update generate_world_map.bin.py (#640)
Use bytes instead of strings to write ADSB map binary for python3
2022-05-09 07:27:15 +12:00
Brumi-2021 dda543f7f3 Merge branch 'eried:next' into next 2022-05-08 12:39:27 +02:00
Brumi-2021 de1570d8af Allow change initial gain amp values just opened file (#634)
* Update spectrum_collector.cpp

lower case correction

* Update spectrum_collector.cpp

Description changed , better explanation.

* Revert "Update spectrum_collector.cpp"

This reverts commit 4a6fc35384.

* Revert "Update spectrum_collector.cpp"

This reverts commit 35cece1cb0.

* Revert "Solving Compile error on gcc10 . Keeping same safety protection about the size of the array ,but with slightly different sintax."

This reverts commit f4db4e2b53.

* Allow initial GAIN ,AMP changes after opened  file
2022-05-07 11:43:55 +12:00
Brumi-2021 1027e80d53 Recovered lost ctcss/roger beep/correct mic gain in mic app from 1.5.1 without ALC (Auto mic Limit Control-AK) (#633)
* Update spectrum_collector.cpp

lower case correction

* Update spectrum_collector.cpp

Description changed , better explanation.

* Revert "Update spectrum_collector.cpp"

This reverts commit 4a6fc35384.

* Revert "Update spectrum_collector.cpp"

This reverts commit 35cece1cb0.

* Revert "Solving Compile error on gcc10 . Keeping same safety protection about the size of the array ,but with slightly different sintax."

This reverts commit f4db4e2b53.

* Recovered CTCSS-Roger_beep-MIC-GAIN from 1.5.1

* Temporary removing ALC-( for AK4951 platorm)
2022-05-07 11:43:14 +12:00
Brumi-2021 92844a7528 Merge branch 'eried:next' into next 2022-05-06 21:55:27 +02:00
Erwin Ried c9db1aab30 Merge pull request #630 from TQMatvey/next
Fix KeyFob (beta) being off-screen
2022-05-05 14:57:35 +02:00
TqMatvey 367cb318cd Fix KeyFob (beta) being off-screen 2022-05-05 18:06:15 +07:00
jLynx fe33c12111 Sound/white noise Clock fix (#625) 2022-05-05 08:31:54 +12:00
ArjanOnwezen 8957d692ea Merge pull request #623 from GullCode/touch_return_option
Added a ui_config flag to manage gui return icon status
2022-05-04 13:47:34 +02:00
GullCode 5551c6a676 Fixing branch, moving block, adding quote 2022-05-04 10:29:12 +02:00
GullCode 2b7b0d028a Merge branch 'touch_return_option' of github.com:GullCode/portapack-mayhem into touch_return_option 2022-05-03 14:42:40 +02:00
GullCode 7b42d9ec94 changed label to fit the screen 2022-05-03 14:34:55 +02:00
GullCode 0580a528e4 Merge branch 'next' into touch_return_option 2022-05-03 14:31:03 +02:00
GullCode c75c4685cd Added a ui_config flag to manage gui return icon status 2022-05-03 14:23:58 +02:00
Brumi-2021 ef52339b1d Merge branch 'eried:next' into next 2022-05-02 20:05:42 +02:00
ArjanOnwezen da49743cc4 Merge pull request #619 from ArjanOnwezen/save-app-settings
Save individual app settings.
2022-05-01 21:19:09 +02:00
Arjan Onwezen 799a473b36 Save individual app settings. Currently only for apps in Receive section and basic settings like, LNA, VGA, Rx Amp and Frequency. 2022-05-01 06:09:02 -04:00
Brumi-2021 5e0780839c Merge branch 'eried:next' into next 2022-04-30 16:22:45 +02:00
Jimi Sanchez 85602d145a Update create_nightly_release.yml 2022-04-28 17:15:03 -04:00
Jimi Sanchez 2efab19bf6 Merge branch 'next' of https://github.com/jimilinuxguy/portapack-mayhem into next 2022-04-28 17:06:50 -04:00
Jimi Sanchez 4562228b55 Fixing spelling of Wav Viewer 2022-04-28 17:06:45 -04:00
Jimi Sanchez b56acb0c9d Merge pull request #2 from jimilinuxguy/jimi-merging-conflicts
Jimi merging conflicts
2022-04-28 17:03:37 -04:00
Jimi Sanchez 6af0d4e751 Merge branch 'next' into jimi-merging-conflicts 2022-04-28 17:03:24 -04:00
Jimi Sanchez 0fed174a80 Adding back wipe sd 2022-04-28 16:58:44 -04:00
Jimi Sanchez d71c759480 Merge branch 'next' into jimi-merging-conflicts 2022-04-28 13:55:44 -04:00
Jimi Sanchez c1e568f62c Removing wipe sd 2022-04-28 13:54:17 -04:00
Jimi Sanchez db1b7ffddf Merge branch 'next' of https://github.com/jimilinuxguy/portapack-mayhem into next 2022-04-28 13:52:55 -04:00
Jimi Sanchez f48980e381 Adding playlist to CMakeLists 2022-04-28 13:52:47 -04:00
Jimi Sanchez cdaa6683ae Adding playlist to CMakeLists 2022-04-28 13:49:36 -04:00
ArjanOnwezen dccc68a4e0 Merge pull request #610 from zigad/fix-title-inconsistancy
Fix #494 - Change App Titles
2022-04-27 12:49:03 +02:00
Arne Luehrs d2dbad73c7 Merge branch 'eried:next' into next 2022-04-27 10:16:26 +02:00
Žiga Deisinger ee9b4c89bd Fix #494 - Change App Titles
I choose what I think are the best Titles based on existing titles/class names and so on. There were also inconsistencies between TX and Transmit and RX and receive. I renamed them to shorter version TX and RX also added it as suffix where possible to make it clearer in what mode you are in. If you have any other title suggestions or changes please use Add comment on Files Changed Screen so I can change it.
2022-04-26 23:09:24 +02:00
Erwin Ried a91bbe6a2e Merge pull request #596 from GullCode/proc-adsbrx-warning-fix
Fix for warning: comparison of integer expressions of different signedness
2022-04-22 10:00:05 +02:00
Erwin Ried a5a9bc85f8 Merge pull request #597 from GullCode/proc-aprsrx-warning-fix
Fix for proc_aprsrx and aprs_packet warnings, they are related
2022-04-22 09:59:31 +02:00
Erwin Ried b23addd452 Merge pull request #598 from GullCode/tpms-warning-fix
Fix for warning: narrowing conversion
2022-04-22 09:59:21 +02:00
Erwin Ried 6467e5e7e6 Merge pull request #599 from GullCode/proc_mictx-warning-fix
Fix for warning: 'MicTXProcessor::modulator' should be initialized
2022-04-22 09:59:08 +02:00
Erwin Ried 35ed394b37 Merge pull request #601 from GullCode/ais_app-warning-fix
Added missing contructors/operators/etc in ais_app
2022-04-22 09:59:01 +02:00
Erwin Ried 4c98cf16a1 Merge pull request #600 from GullCode/ui_qrcode-warning-fix
Fix for weffc++
2022-04-22 08:19:43 +02:00
Erwin Ried 18be6750e5 Merge pull request #602 from GullCode/ui_adsb_rx-warning-fix
Added missing initializer
2022-04-22 08:19:03 +02:00
Erwin Ried 4f58be737a Merge pull request #603 from GullCode/proc_pocsag-warning-fix
Fix warning for proc_pocsag
2022-04-22 01:04:22 +02:00
GullCode 3fa190324b Fix warning for proc_pocsag 2022-04-21 23:25:58 +02:00
GullCode de042df7eb Added missing initializer 2022-04-21 23:12:37 +02:00
GullCode 2fbf96425a Added missing contructors/operators/etc in ais_app 2022-04-21 22:52:17 +02:00
GullCode 85d5a8fdba Fix for weffc++ 2022-04-21 22:27:20 +02:00
GullCode f13d1f8b9c Fix for warning: 'MicTXProcessor::modulator' should be initialized 2022-04-21 21:46:55 +02:00
GullCode f804d7997c Fix for warning: narrowing conversion 2022-04-21 21:41:02 +02:00
GullCode 2108ea53fa Fix for proc_aprsrx and aprs_packet warnings, they are related 2022-04-21 17:38:49 +02:00
GullCode 90d38af705 Fix for warning: comparison of integer expressions of different signedness 2022-04-21 17:29:42 +02:00
Erwin Ried d617618dcd Merge pull request #592 from GullCode/ui-aprs-rx-warning-fix
Fix for warning XXX should be initialized
2022-04-21 09:15:53 +02:00
GullCode c37df0c6fd Fix for warning XXX should be initialized in the member initialization list 2022-04-19 17:23:30 +02:00
Erwin Ried cdba4fa5bf Merge pull request #590 from GullCode/a-packet-warning-fix
Fixed warning: comparison of integer expressions of different signedness
2022-04-18 23:29:41 +02:00
Erwin Ried 1537b1eccb Merge pull request #589 from GullCode/qrcode-warning-fix
Qrcode warning fix
2022-04-18 23:29:08 +02:00
GullCode 048b254354 Fixed uninitialized class members 2022-04-18 22:45:16 +02:00
GullCode 4b87a8a7dd Fixed warning: comparison of integer expressions of different signedness 2022-04-18 22:38:29 +02:00
GullCode 5cdaac6b82 Fix uneeded negative test because type is uint ( warning: comparison is always false due to limited range of data type) 2022-04-18 22:33:10 +02:00
GullCode 17aa58bbf8 Changed pramga to comments to fix warning: ignoring #pragma mark [-Wunknown-pragmas] 2022-04-18 22:32:43 +02:00
Erwin Ried e93a5820a2 Merge pull request #587 from notpike/grc
Added GRC C16 to complex script
2022-04-17 20:45:54 +02:00
notpike 0e9c7448c0 Added GRC C16 to complex script 2022-04-17 11:05:20 -07:00
jLynx 9f54f4b5eb Added stable release pipeline (#573) 2022-04-13 18:02:43 +12:00
jLynx 178528ef96 Fixed no audio issue v2 (#567)
* Fixed no audio issue v2 (#567)
2022-04-12 09:28:36 +12:00
jLynx 5d9a2e560b SD card backup storage (#565)
* Got SD card mounting during boot

* Cleaned up comments

* Now loads settings from SD as backup

* Now loads settings from SD as backup

* linting

* refactoring
2022-04-11 21:42:56 +12:00
ArjanOnwezen b02329019c Merge pull request #556 from ArjanOnwezen/settings-cancel-button
Added cancel button in UI settings.
2022-04-08 23:57:03 +02:00
Arjan Onwezen 8c1593fab9 Added cancel button in UI settings. 2022-04-08 17:50:21 -04:00
ArjanOnwezen 1f27af660d Merge pull request #482 from zigad/feature/disableTouch
Enable / Disable Touchscreen
2022-04-08 22:59:18 +02:00
ArjanOnwezen a9d2b2ff8a Merge branch 'next' into feature/disableTouch 2022-04-08 16:10:55 +02:00
ArjanOnwezen a81d630d93 Merge pull request #555 from ArjanOnwezen/fix-scanner-only-audio-output-the-first-tim
Quick fix (as figures out by @bluegizmo83) to make sure WM8731S chips…
2022-04-08 15:59:18 +02:00
Arjan Onwezen efdefa85be Quick fix (as figures out by @bluegizmo83) to make sure WM8731S chips don't stay silent after pause in scanner app. 2022-04-08 09:51:41 -04:00
ArjanOnwezen f25ce9ed45 Merge pull request #554 from ArjanOnwezen/bigger-qr-code
Option to set bigger qr code (used in RadioSonde app)
2022-04-08 14:59:03 +02:00
Arjan Onwezen 6697d2533c Added support for LARGE qr code. 2022-04-08 08:38:32 -04:00
ArjanOnwezen 6cf5990b0e Merge pull request #38 from eried/next
[pull] next from eried:next
2022-04-08 12:35:42 +02:00
jLynx c97e1042b1 Merge pull request #550 from jLynx/QFP_fix
QFP100 Fix pt. 2
2022-04-08 12:45:49 +12:00
jLynx 9d5ed65f6b Added the most random fix 2022-04-08 12:42:12 +12:00
jLynx 2ba74d0413 What did I change? 2022-04-08 12:31:06 +12:00
jLynx a824e30420 Merge pull request #547 from jLynx/FM_fix
Fixed broken radio offset
2022-04-08 08:21:11 +12:00
jLynx 59d08a4203 Enabled auto detection again 2022-04-07 21:30:37 +12:00
jLynx 51bc0f0100 Fixed broken radio offset 2022-04-07 21:22:47 +12:00
jLynx 9412dd8bec Merge pull request #546 from eried/next
V1.5.0
2022-04-07 20:42:05 +12:00
jLynx d2e185a1fb 2021/12 QFP100 Fix
2021/12 QFP100 fix
2022-04-07 09:20:37 +12:00
jLynx 2d3cb426ba Stores in memory 2022-04-07 09:11:10 +12:00
jLynx dd2fdecb21 removed commented lines 2022-04-07 08:48:00 +12:00
jLynx a37ba1ee2b 2021/12 QFP100 fix 2022-04-07 08:41:46 +12:00
ArjanOnwezen 9fbcab4224 Update README.md 2022-04-06 17:59:32 +02:00
Jimi Sanchez 505f26c98a Merge pull request #540 from jLynx/next
Nightlys now include flashing software
2022-04-06 05:45:20 -04:00
jLynx dc18e340ab Update create_nightly_release.yml 2022-04-06 21:34:35 +12:00
jLynx 3e86f83099 Merge pull request #539 from jLynx/flashing
Added exe's to flashing folder
2022-04-06 20:52:23 +12:00
jLynx d98f2b40df Added exe's 2022-04-06 20:52:01 +12:00
jLynx e26d026216 Merge pull request #536 from jLynx/gen1
Fixed R1_20150901 vs R2_20170522 boot & detection issues. Read up about it here https://github.com/eried/portapack-mayhem/wiki/Won't-boot
2022-04-06 13:52:00 +12:00
jLynx 0c0d47b0d2 Added persistent memory of save state 2022-04-06 13:28:10 +12:00
jLynx 50821bab55 Added button on boot detection 2022-04-06 08:16:57 +12:00
jLynx 796d9ca854 Updated comments 2022-04-05 14:44:32 +12:00
jLynx fd8bc177ad Added support for H2+ 2022-04-05 14:41:12 +12:00
jLynx eab832396b Merge pull request #537 from jLynx/flashing
Added flashing tools
2022-04-05 11:14:16 +12:00
jLynx 3bb7ba59ae Added flashing tools 2022-04-05 11:13:12 +12:00
jLynx f6c496d1d3 removed comments 2022-04-05 10:56:09 +12:00
jLynx b4a6b958e5 Fixed R1_20150901 vs R2_20170522 boot & detection issues 2022-04-05 10:53:52 +12:00
jLynx 43e9ce4704 Fixed R1_20150901 vs R2_20170522 boot & detection issues 2022-04-05 10:52:42 +12:00
Erwin Ried b4e5fb7483 Merge pull request #534 from jLynx/changelog
Added changelog to release notes v2
2022-04-04 12:03:14 +02:00
Jimi Sanchez d624b92e85 Adding helper header for playlist file 2022-04-03 19:42:48 -04:00
Jimi Sanchez 584c46af64 Initial commit of playlist app for replaying capture files sequentially 2022-04-03 19:38:06 -04:00
jLynx 29d3a0f1dd Added python script to parse changelog 2022-04-04 09:00:41 +12:00
jLynx 1e413d034f WIP python 2022-04-04 08:54:43 +12:00
jLynx 5627634da1 Removed usernames for the moment 2022-04-04 07:33:14 +12:00
jLynx 719e7d42fd Removed usernames for the moment 2022-04-04 07:32:55 +12:00
jLynx 71d9fd1c87 Update with next 2022-04-04 07:15:24 +12:00
Erwin Ried 58bdd358c6 Merge pull request #529 from jLynx/version_automation
Version automation/injection
2022-04-03 12:28:14 +02:00
Erwin Ried 27c93e144b Merge pull request #530 from jLynx/stop_duplicate_nightly
Stops duplicate nightly builds
2022-04-03 12:27:36 +02:00
Erwin Ried 04f781ff52 Merge pull request #532 from eried/revert-531-changelog
Revert "Added changelog to release notes"
2022-04-03 12:27:14 +02:00
Erwin Ried 7a8637fb96 Revert "Added changelog to release notes" 2022-04-03 12:26:57 +02:00
Erwin Ried 054a931967 Merge pull request #531 from jLynx/changelog
Added changelog to release notes
2022-04-03 12:23:46 +02:00
jLynx 0a660aa5c0 Synced up SD card file name 2022-04-03 21:22:32 +12:00
jLynx 9c5bf8dcc0 Added changelog to release notes 2022-04-03 21:07:20 +12:00
jLynx 57df9dd2b7 Wont run if no changes in the last 24 hours 2022-04-03 15:36:37 +12:00
jLynx b33ef608ee Updated nightly release script 2022-04-03 09:15:06 +12:00
jLynx a17eb47657 Fixed typo in cmake 2022-04-03 08:50:08 +12:00
Brumi-2021 1976c3648b Merge branch 'eried:next' into next 2022-04-02 13:23:43 +02:00
jLynx 250553e4ba Updated format 2022-04-02 22:40:00 +13:00
Jimi Sanchez c4eb02422b Merge pull request #1 from eried/next
Merging changes
2022-04-02 05:10:41 -04:00
jLynx 9200db24be WIP 2022-04-02 22:02:05 +13:00
jLynx 03057546e1 WIP 2022-04-02 22:00:46 +13:00
Erwin Ried 486b064e08 Merge pull request #528 from jLynx/actions
Added nightly release pipeline
2022-04-02 03:34:45 +02:00
jLynx e4836a5e5c Removed comments 2022-04-02 12:46:51 +13:00
jLynx ad742a84e3 Added nightly pipeline 2022-04-02 12:38:19 +13:00
ArjanOnwezen eec4cd8778 Delete icao24.db
delete duplicated  icao24.db, since it should only be placed in /sdcard/ASDB folder
2022-04-01 14:02:03 +02:00
ArjanOnwezen d7a795b8f2 Delete mids.db
delete duplicate mids.db, since it should only be placed in /sdcard/AIS folder
2022-04-01 14:00:57 +02:00
ArjanOnwezen 579caa93b2 Merge pull request #527 from jLynx/TPMS_433
Updated TPMS 433 label
2022-04-01 11:39:37 +02:00
jLynx 3601545712 Updated to say 433 as it's not 434 2022-04-01 22:22:25 +13:00
ArjanOnwezen f7b219fc2b README.md added 2022-04-01 10:48:51 +02:00
eried 85cfdd75cc Rename the sample files 2022-04-01 10:05:06 +02:00
Erwin Ried deef2ebdc2 Merge pull request #526 from jLynx/Tesla_Charger
Added Tesla charge door open samples
2022-03-31 10:54:08 +02:00
jLynx 79a2c3a372 Added Tesla charge door open samples 2022-03-31 08:57:15 +13:00
eried 759c4d9d51 Contributors update 2022-03-29 08:28:31 +02:00
eried 77a0d255dd Version bump 2022-03-29 08:15:44 +02:00
eried 671fc12cf7 Tesla charge port open example
Thanks to @jLynx
2022-03-29 08:14:39 +02:00
Erwin Ried e1446598a8 Merge pull request #521 from notpike/audio_datetime_freq
Added Datetime + Freq Filename to Audio App
2022-03-29 08:10:09 +02:00
NotPike 7066f931a8 Update ui_record_view.cpp
cleanup
2022-03-29 01:16:16 -04:00
NotPike aa2c5a4c84 Update analog_audio_app.hpp
Forgot to take that include out. >_<
2022-03-29 00:34:52 -04:00
notpike d70e1a6fac Added Datetime + Freq Filename to Audio App 2022-03-28 20:53:09 -07:00
Brumi-2021 95ac4a2d1e Merge branch 'eried:next' into next 2022-03-28 18:13:24 +02:00
Erwin Ried 477e6d65df Merge pull request #488 from ArjanOnwezen/improve-screen-navigation
Improvements to screen navigation
2022-03-28 10:10:46 +02:00
Erwin Ried a55e5d4fc0 Merge pull request #497 from Brumi-2021/Solving_mic_saturation_and_spectrum_armonics_Mic_App
Solving_mic_saturation_and_spectrum_harmonics_Mic_App
2022-03-28 10:10:08 +02:00
Erwin Ried 8da0dbe36b Merge pull request #519 from notpike/replay_antenna_bias
Replay App Enable Bias-tee
2022-03-28 10:09:51 +02:00
Erwin Ried 8688ac0e05 Merge pull request #520 from ArjanOnwezen/add-country-info-to-ais-app
Added country to AIS app, so you know from which country a vessel is.
2022-03-28 10:08:39 +02:00
Erwin Ried 82732a3f73 Merge pull request #512 from jLynx/PSI
TPMS toggle between PSI and kPa (v1)
2022-03-28 10:07:41 +02:00
Arjan Onwezen be0427889f Added country to AIS app, so you know from which country a vessel is.
It's using the MID database, which is also part of the PR.
mids.db should be placed in /AIS folder on SD card.
2022-03-27 12:34:26 -04:00
NotPike 37a40cbeda Delete ui_newapp.hpp 2022-03-27 00:40:45 -04:00
notpike 4ef98e2928 Added Bias Tee support for Replay and fixed file error logic bug 2022-03-26 21:20:55 -07:00
notpike 434c559861 Added Bias Tee support for Replay and fixed file error logic bug 2022-03-26 21:20:49 -07:00
Brumi-2021 a7c7495428 Merge branch 'eried:next' into next 2022-03-26 21:56:38 +01:00
Erwin Ried 3cb3c95349 Merge pull request #516 from ArjanOnwezen/updated-airlines.db
updated airlines.db
2022-03-25 15:44:32 +01:00
Erwin Ried 979b5126a6 Merge pull request #517 from ArjanOnwezen/updated-icao24.db
updated icao24.db
2022-03-25 15:43:56 +01:00
Arjan Onwezen 8e3fa0b9ea updated icao24.db 2022-03-25 10:18:22 -04:00
Arjan Onwezen 00b43299ad updated airlines.db 2022-03-25 08:47:47 -04:00
Erwin Ried 1f31e9b983 Merge pull request #514 from jLynx/NZ_APRS
Added NZ to APRS app
2022-03-24 08:44:24 +01:00
jLynx 5c97c24b48 Added NZ to APRS 2022-03-24 20:36:39 +13:00
jLynx 4a8458d812 refactoring 2022-03-24 19:51:08 +13:00
jLynx 165efd7355 refactoring 2022-03-24 19:44:26 +13:00
jLynx d1d1198b1b refactoring 2022-03-24 19:43:26 +13:00
jLynx 0025ad2507 refactoring 2022-03-24 19:19:02 +13:00
jLynx 32f957cead WIP updating header 2022-03-24 19:08:07 +13:00
jLynx 2030118d9f WIP can now switch between kPa and PSI 2022-03-24 17:05:38 +13:00
jLynx 0523aabe91 WIP PSI selector 2022-03-24 16:10:55 +13:00
jLynx 1c81c7a8ba Revert "Added NZ to APRS"
This reverts commit 9df1cfa670.
2022-03-23 21:32:32 +13:00
jLynx 9df1cfa670 Added NZ to APRS 2022-03-23 20:51:10 +13:00
eried 68d40ebce8 Revert "Open the Tesla charge port"
This reverts commit c2856ce089.
2022-03-21 11:47:05 +01:00
Erwin Ried 901af22de5 Merge pull request #506 from ArjanOnwezen/#484-add-consecutive-ids-in-message.hpp
Added consecutive id's in message.hpp, as mentioned in #484.
2022-03-21 11:45:46 +01:00
Arjan Onwezen d9c1b6b61f Added consecutive id's in message.hpp, as mentioned in #484. 2022-03-20 13:38:53 -04:00
Erwin Ried 8774ee0acd Merge pull request #485 from ArjanOnwezen/centralize-database-functions
centralize-db-retrieval-functions
2022-03-18 22:05:09 +01:00
eried c2856ce089 Open the Tesla charge port
files from https://github.com/HackingIntoYourHeart/Tesla-Charging-Port-Opener
2022-03-14 08:52:36 +01:00
Brumi-2021 d5a1733c1c Solving_mic_saturation_and_spectrum_armonics_Mic_App 2022-03-05 21:39:53 +01:00
Arne Luehrs 8f311ea1f2 Merge pull request #1 from eried/next
Sync with upstream
2022-02-25 15:00:45 +01:00
Brumi-2021 d0643421a8 Merge branch 'eried:next' into next 2022-02-04 20:13:04 +01:00
Erwin Ried 98c0ff1e47 Merge pull request #490 from notpike/file
Added return codes for delete_file() and rename_file() in file.hpp
2022-02-03 01:51:34 +01:00
Brumi-2021 adb0cdf8fb Merge branch 'eried:next' into next 2022-02-01 23:20:00 +01:00
notpike e00d91e1d2 Added return codes for delete_file() and rename_file() for file.hpp 2022-02-01 10:37:38 -08:00
Erwin Ried 459b8efc52 Merge pull request #487 from Brumi-2021/Add_Gain_TX_control_to_GPS_Simulator_issue#480
Add_Gain_TX_to_GPS_sim_App_issue_480
2022-01-31 09:43:20 +01:00
Erwin Ried db3f645131 Merge pull request #489 from Brumi-2021/“Antenna_DC_Bias_missing_in_AIS_and_RADIOSONDE”
“antenna dc bias missing in ais and radiosonde”
2022-01-31 09:41:11 +01:00
Brumi-2021 b84820963b Revert "Revert "“Antenna_DC_Bias_missing_in_AIS_and_RADIOSONDE”""
This reverts commit 4de25a2039.
2022-01-30 11:37:46 +01:00
Arjan Onwezen ec23dd8edf some improvements to screen navigation 2022-01-30 05:12:46 -05:00
Brumi-2021 4de25a2039 Revert "“Antenna_DC_Bias_missing_in_AIS_and_RADIOSONDE”"
This reverts commit 4a57af64ce.
2022-01-30 10:58:43 +01:00
Brumi-2021 a11b9c492f Add_Gain_TX_to_GPS_sim_App_issue_480
Add Gain control to the GPS Sim App .
(we are clonning the two previous PR's n #395 and #446 of the Replay App, correcting TX Gain control to this GPS Sim App )
2022-01-29 23:29:17 +01:00
Brumi-2021 1b93a042a3 Merge branch 'next' of https://github.com/Brumi-2021/portapack-mayhem into next 2022-01-29 12:19:06 +01:00
Arjan Onwezen 867539ce9c centralize-db-retrieval-functions 2022-01-28 10:24:49 -05:00
Erwin Ried 799a701fc3 Merge pull request #479 from MichalLeonBorsuk/next
Some frequencies were shitfed by a few kHz
2022-01-27 20:02:12 +01:00
Žiga Deisinger cebbc12084 Enable / Disable Touchscreen #481
This commit will reverse the logic of touch screen as suggested by @ArjanOnwezen
2022-01-27 14:23:22 +01:00
Žiga Deisinger 4a0d42ed34 Add code for feature "Disable Touch" 2022-01-26 21:52:08 +01:00
Michał Borsuk 0d5af740a5 correction of spelling of units 2022-01-26 18:08:56 +01:00
Michał Borsuk 0da0431e5e Some frequencies were shitfed by a few kHz
I worked with DAB and noticed that some frequencies were not correct. I've imported data from http://www.wohnort.org/dab/freqs.html, which is a reliable source that I've used in the past.
2022-01-26 17:51:38 +01:00
Žiga Deisinger 96879d3664 Add code for feature "Disable Touch" 2022-01-26 14:53:31 +01:00
Erwin Ried ea251a87c0 Merge pull request #477 from zigad/bugfix-#473
Fix ADS-B not updating Altitude in Map #473
2022-01-24 09:26:05 +01:00
Erwin Ried 7fa64a3f76 Merge pull request #475 from zigad/ZARE
Added Slovenian Emergency Frequencies (ZARE)
2022-01-24 01:07:21 +01:00
Žiga Deisinger 7af7279ea4 Fix ADS-B not updating Altitude in Map #473
This commit will fix altitude not automatically updating when in Map mode. Also set default altitude for AIS to 0.
2022-01-23 22:34:01 +01:00
Žiga Deisinger 9726a50533 Added Slovenian Emergency Frequencies (ZARE) 2022-01-23 01:13:50 +01:00
Erwin Ried f42479c190 Merge pull request #470 from ArjanOnwezen/prepadding-MMSI-in-AIS
Prepadded MMSI in AIS app with zeros, so it's always 9 chars long
2022-01-17 10:35:07 +01:00
Arjan Onwezen dcb67049af Prepadded MMSI in AIS app with zeros, so it's always 9 chars long as in the specs. 2022-01-16 05:06:53 -05:00
Brumi-2021 4a57af64ce “Antenna_DC_Bias_missing_in_AIS_and_RADIOSONDE” 2022-01-15 23:09:42 +01:00
Erwin Ried 30449e0adf Merge pull request #467 from ArjanOnwezen/gui-glitch-in-adsb-rx
Small GUI glitch in ADSB RX
2022-01-12 19:06:14 +01:00
Arjan Onwezen c9a813fbd6 GUI glitch in ADSB RX 2022-01-12 10:31:59 -05:00
eried 0da7d2d0ac Version bump 2022-01-12 15:35:35 +01:00
eried 7c8f02d05a Update credits 2022-01-12 15:35:30 +01:00
Erwin Ried e5015cc67b Merge pull request #446 from Brumi-2021/“Indep_persistent_memory_14dBs_RF_tx-rx_amp”
Minor improvements to the previous PR #395 Add Gain_TX to Replay App
2022-01-12 15:19:54 +01:00
Erwin Ried 03c9812487 Merge pull request #457 from Brumi-2021/Solving_14dBs_lower_TX_AM_than_FM_TX_in_MIC_App
Minor improvements, to the previous excellent PR #329 AM-SSB-DSB Mic Functional from  aldude999
2022-01-10 11:05:23 +01:00
Erwin Ried fc08d0ba2d Merge pull request #452 from ArjanOnwezen/add-operator-to-icao-24
Added operator to ICAO24 file
2022-01-10 11:04:15 +01:00
Erwin Ried dfa7dfb024 Merge pull request #461 from notpike/touchtunes
Touchtunes EW Mode Feature
2022-01-04 10:55:22 +01:00
notpike c713d996ad TouchTunes TouchTunes New Feature QA 2022-01-03 20:15:54 -08:00
notpike c2ff37a1c7 TouchTunes TouchTunes New Feature QA 2022-01-03 19:57:51 -08:00
notpike 8ee650503c TouchTunes TouchTunes New Feature QA 2022-01-03 19:49:50 -08:00
notpike 47014b35ad TouchTunes new functions 2022-01-03 19:14:05 -08:00
Erwin Ried 0648e0d9bd Merge pull request #460 from ArjanOnwezen/qr-for-radiosonde
Added QR code generator with geo URI for radiosonde
2022-01-03 10:19:38 +01:00
Erwin Ried 094fa4c905 Update README.md
Link to a cheaper item with more accesory options
2022-01-03 10:14:54 +01:00
Arjan Onwezen 0a05c63c47 added qr code for radiosonde 2022-01-02 17:09:45 -05:00
Brumi-2021 f4403121a1 Minor improvementes to the previous PR #329 AM-SSB-DSB Mic Functionality App 2022-01-01 12:26:35 +01:00
Arjan Onwezen 9792e13cbf fixes and cleanup 2021-12-17 14:27:00 -05:00
Erwin Ried 6c4dec59bb Merge pull request #451 from ArjanOnwezen/adsb-metadata-improvemens
ADS-B metadata improvements
2021-12-14 10:47:14 +01:00
Arjan Onwezen 455389f1d1 fixes and cleanup 2021-12-12 05:09:06 -05:00
Arjan Onwezen 4a0a243530 added binary search tree lookup to airlines.db 2021-12-12 04:48:11 -05:00
Arjan Onwezen 3cb9e1849b added ICAO special designators, to aircraft types 2021-12-12 04:38:05 -05:00
Brumi-2021 d0f9073b67 Minor improvementes to the previous PR #395 Add Gain_TX to Replay App 2021-12-05 16:18:52 +01:00
Erwin Ried e2a2f7a448 Merge pull request #441 from ArjanOnwezen/make-icao24-db
Show aircraft info based on ICAO 24 bit transponder code in ADS-B app
2021-12-03 10:22:58 +01:00
Arjan Onwezen 708111066e removed duplicate file, README changes 2021-12-01 17:32:13 -05:00
Arjan Onwezen 2a2abac244 added aircraft info to ADS-B app 2021-12-01 17:23:40 -05:00
Erwin Ried c3da2863d5 Merge pull request #438 from Brumi-2021/Change_REC_icon_colour
Minor GUI change Capture App : Change "REC" icon background colour from black -> yellow , BW Options >600Khz
2021-11-29 03:19:12 +01:00
Arjan Onwezen 96db26e884 added icao24.db database and tool generator 2021-11-28 11:08:34 -05:00
Brumi-2021 9f48199a96 Changing background icon to yellow in the decimated files recording 2021-11-27 23:36:44 +01:00
Erwin Ried 834b65d833 Merge pull request #437 from ckuethe/next
Add some details about pagers in the US
2021-11-25 08:27:55 +01:00
Chris Kuethe 662eb0a7f9 limit of 99 frequencies per file 2021-11-24 16:59:35 -08:00
Chris Kuethe f60aab68a1 Add some details about pagers in the US 2021-11-24 15:45:04 -08:00
Brumi-2021 52c6d0e4ed Merge branch 'next' of https://github.com/Brumi-2021/portapack-mayhem into next 2021-11-24 21:10:08 +01:00
Brumi-2021 05a09bc988 Merge branch 'eried:next' into next 2021-11-24 21:10:00 +01:00
eried a07683b2a6 Merge branch 'next' 2021-11-24 14:58:11 +01:00
eried e3de466743 Version bump 2021-11-24 14:55:06 +01:00
eried 3903aec071 Update credits 2021-11-24 13:47:47 +01:00
Erwin Ried 2a11b59ab7 Merge pull request #424 from intoxsick/custom-splash-screen-from-sd
Custom splash screen from sd
2021-11-24 12:35:41 +01:00
Erwin Ried 0d1d703ba9 Merge pull request #426 from heurist1/update_pocsag_decoder
Update pocsag decoder
2021-11-24 12:32:33 +01:00
Erwin Ried 84ea106f79 Merge pull request #433 from Brumi-2021/New_feature_Increase_freq_range_to_App_Capture
Increase more BW Options to Capture App
2021-11-24 12:31:47 +01:00
Erwin Ried dc06950a94 Merge pull request #419 from Brumi-2021/Final_correction_GCC_10_Compile_error_#199_with_sharebrained_feedback
Final correction gcc 10 compile error #199 with sharebrained feedback
2021-11-24 12:31:29 +01:00
Erwin Ried cf82a3f439 Update README.md 2021-11-24 12:30:28 +01:00
Erwin Ried 16923717d9 Merge pull request #434 from ArjanOnwezen/make-airlines.db
new airlines_db
2021-11-23 10:38:10 +01:00
ArjanOnwezen 23ec3ff11b Update ui_adsb_rx.cpp 2021-11-23 00:16:03 +01:00
Arjan Onwezen bbd9a865de new airlines_db 2021-11-22 17:13:46 -05:00
Erwin Ried e985efd78b Merge pull request #422 from heurist1/adsb-improve-decode-and-gui
Adsb improve decode and gui
2021-11-22 20:53:29 +01:00
Brumi-2021 14484b550a Increase more BW Options to Capture App
PR to increase the BW Options in the Capture App , beyond the current max, 500khz.  (from 600Khz till 2,75Mhz)  all of them work well into  the screen, but only <=  600Khz BW are correctly saved  into SD Card with full captured data. (Onwards, >600Khz optiions, at the moment ,  the created SD card  file has  decimated data, due - to SD Card writting speed limitations),-  but I feel still quite interesting feature to keep them.
2021-11-21 19:35:31 +01:00
Brumi-2021 55fac01ab5 Merge branch 'eried:next' into next 2021-11-21 19:33:02 +01:00
ArjanOnwezen 4fcf2cd724 Update LICENSE.md 2021-11-17 12:27:27 +01:00
Erwin Ried 6aa88fb5f9 Merge pull request #432 from ArjanOnwezen/license-correction
License correction
2021-11-17 12:16:38 +01:00
ArjanOnwezen 8f8af0732f Create LICENSE
added GPL3 license
2021-11-17 12:15:52 +01:00
ArjanOnwezen 4322670dbc license-correction
Renamed license file to prevent GitHub to detect wrong licence (GPL v2 i.s.o. GPL v2 or later)
Add correct license for ChiBIOS (GPL v3).
2021-11-17 10:17:53 +01:00
ArjanOnwezen 602a8e6e7f license-correction 2021-11-17 10:15:36 +01:00
Erwin Ried 535f671284 Merge pull request #429 from heurist1/add_2_button_press_back_aka_topleft
Added a quick way of moving the cursor to the top left (back) location
2021-11-14 20:10:04 +01:00
heurist1 40654aba55 moved extract frame back into proc_pocsag 2021-11-07 09:00:00 +00:00
nick aa9917be20 Update hackrf 2021-11-07 06:46:49 +01:00
heurist1 3bbad90949 Scale new integerised power to a better range 2021-11-06 12:35:37 +00:00
heurist1 a0a1954138 Forgot it was called 128 squared 2021-11-06 10:26:01 +00:00
heurist1 94ec0c9087 Sort scaling in GUI 2021-11-06 10:20:39 +00:00
heurist1 a571e40c59 Changed amp to integer 2021-11-06 10:15:17 +00:00
heurist1 79b24ebe13 Improve output 2021-11-01 22:51:06 +00:00
heurist1 8a4564f6f5 Slow down redraw
Combine improvements and slow down refresh.
2021-11-01 20:37:27 +00:00
heurist1 1a21e06bbe Improved overlap packet detection
Improved overlap detection and reduced the threshold
2021-11-01 19:28:56 +00:00
eried da380261b2 Version bump 2021-11-01 11:49:42 +01:00
eried 790ebdff31 Updating the contributors list 2021-11-01 11:48:14 +01:00
eried cf906684cc Merge branch 'next' 2021-11-01 11:46:06 +01:00
heurist1 0d51e3569f Improved decode of type 17 at expense of others
Reject all non type 17 packets
2021-10-31 13:23:48 +00:00
heurist1 0d7bbac6a1 Added switching message length
Improves detections in test file from 77 to 80
2021-10-30 00:53:29 +01:00
heurist1 b499380448 Keep items with loc above those without
Removed fixsbt and added a new state of signal without position. Positions stay higher than non positions.
2021-10-29 16:59:52 +01:00
Brumi-2021 22a5ca7df7 Merge branch 'next' of https://github.com/Brumi-2021/portapack-mayhem into next 2021-10-25 20:47:33 +02:00
Brumi-2021 ab8f93805d Small correction,of previous PR , about New_Feature_GCC_10_Compile_errors_#199 (based on sharebrained indications) 2021-10-25 18:11:31 +02:00
Brumi-2021 d0b356a7ef Revert "Solving Compile error on gcc10 . Keeping same safety protection about the size of the array ,but with slightly different sintax."
This reverts commit f4db4e2b53.
2021-10-24 01:59:25 +02:00
Brumi-2021 28ee69baae Revert "Update spectrum_collector.cpp"
This reverts commit 35cece1cb0.
2021-10-24 01:58:58 +02:00
Brumi-2021 bfd614b51f Revert "Update spectrum_collector.cpp"
This reverts commit 4a6fc35384.
2021-10-24 01:58:06 +02:00
Brumi-2021 4a6fc35384 Update spectrum_collector.cpp
Description changed , better explanation.
2021-10-24 01:47:42 +02:00
Brumi-2021 35cece1cb0 Update spectrum_collector.cpp
lower case correction
2021-10-24 01:40:08 +02:00
Brumi-2021 f4db4e2b53 Solving Compile error on gcc10 . Keeping same safety protection about the size of the array ,but with slightly different sintax. 2021-10-23 22:17:18 +02:00
heurist1 318720f364 Removed all traces of the parameters on the POGSAG config message
Left in the message for the moment, because there are likely to be parameters needed at some point.
2021-10-22 18:11:50 +01:00
heurist1 6ef24ce71c Removed unused GUI items 2021-10-22 15:41:48 +01:00
heurist1 62f063aef5 Removed unused items from the UI
Removed unused items from the UI
2021-10-21 17:14:08 +01:00
heurist1 110b40ea49 Changed content of table
Changed the columns of the table to be more useful
2021-10-17 10:03:28 +01:00
heurist1 2b045ffca6 Mark where to change 2021-10-15 18:40:02 +01:00
heurist1 be01ca6da1 Significantly improved adsb demod
Change preamble detection, reduce cpu load
2021-10-15 14:26:33 +01:00
heurist1 0fed64636a Store old changes to ADSB
Diff in previous changes to ADSB
2021-10-11 10:14:16 +01:00
heurist1 ab364ca497 POCSAG before reformat
This is the POCSAG code before reformat to put smooth and extract packets in the correct place
2021-10-10 09:15:42 +01:00
heurist1 a49c35088d Added back
Added the ability to use the Up and Left buttons simultaneously to cause the cursor to move to the top left of the screen
2021-10-09 22:46:05 +01:00
Erwin Ried 848dba44d8 Merge pull request #395 from Brumi-2021/New-Feature-Add-Gain_TX-control-to-the-Replay-App
Add Gain_TX control to the Replay App
2021-10-06 01:15:32 +02:00
Erwin Ried 5a21c1c76a Merge pull request #413 from Brumi-2021/New_Feature_Remove_Initial_short_Ant_DC_bias_pulse_when_cold_reset
Update main.cpp
2021-09-27 13:08:52 +02:00
Brumi-2021 b335886f42 Update main.cpp
Remove initial short wrong Ant-DC_BIAS pulse. (250 msegs aprox)
2021-09-25 16:37:30 +02:00
Erwin Ried f12eb55f6b Merge pull request #412 from ArjanOnwezen/fix-backlight-time-out
Fixed #398: Changed datatype to be able to store > 255 second for backlight timer
2021-09-06 06:29:28 +02:00
Arjan Onwezen 6871126100 changed datatype to be able to store > 255 second for backlight timer 2021-09-03 16:46:41 +02:00
Erwin Ried 5b4c3514fb Merge pull request #396 from texasyojimbo/next
Create ISM.TXT
2021-07-31 02:18:20 +02:00
AD5NL af7242f7d1 Create ISM.TXT
Center frequencies for ISM bands. These are probably where we should be transmitting if unlicensed.
2021-07-26 15:39:31 -05:00
Brumi-2021 03eae70555 Add Gain_TX control to the Replay App
Current Replay App , shows in the user menu a UI to select two kind of controls for the RF output level :
1-) LNA GAIN (0..40 ) dB => but it has no TX effect because it is the RX-LNA . GAIN
2-) RF AMP (0 / +14dBm , (that was correct , we have two IC's , RX / TX ) (sw is controlling weill .

Note, although SW Version 1.40 do not leave to control drictly the GAIN TX
, that Replay App , in fact, it was using the inheritated selected GAIN TX from any previous usage of MIC App.

That Pull request alllows now to have the following controls
1-) GAIN TX (0..47 ) dB (now it is OK
2-) RF AMP (0 / +14dBm , (that was correct , we have two IC's , RX / TX ) (sw is controlling weill .

Remakrs : After the change , now we can control the GAIN TX , but not "in the fly" . When we are in the Replay loop , any change of the FREQUENCY or GAIN TX will be ignored , till we play STOP / START the loop again. (but the AMP RF (0 /+14 dBs) it works in the loop withouth any problems (same as before ) .
2021-07-15 18:15:44 +02:00
Erwin Ried 010f06c77c Merge pull request #382 from teixeluis/hotfix-adsb-position
Hotfix to issue #362 - ADS-B RX app aircraft position jitter
2021-06-25 10:13:21 +02:00
teixeluis 2f86fa7e99 Merge branch 'hotfix-adsb-position' of https://github.com/teixeluis/portapack-mayhem into hotfix-adsb-position 2021-06-24 15:16:59 +01:00
teixeluis fe806b7bdc Fixed the mixing of aircraft coordinates in the details view, by
checking if the ICAO address of the frame and the current item
in the details view match. Slight refactor by placing the decimal
to string conversion function into the string_format module.

Added fix in the scope of issue #365

FrequencyStepView field in TransmitterView class

FrequencyStepView field in TransmitterView class

Update ui_transmitter.hpp

Update credits

Fixed left padding of the decimal part of the numbers.
2021-06-24 15:16:19 +01:00
teixeluis 22e8add4dd Fixed left padding of the decimal part of the numbers. 2021-06-24 15:10:06 +01:00
teixeluis 93ce2b04c0 Merge branch 'next' into hotfix-adsb-position 2021-06-24 13:44:48 +01:00
teixeluis b09439afb1 Fixed the mixing of aircraft coordinates in the details view, by
checking if the ICAO address of the frame and the current item
in the details view match. Slight refactor by placing the decimal
to string conversion function into the string_format module.
2021-06-23 23:52:15 +01:00
teixeluis 97349b06ef Fixes to the log and screen rendering of the geo coordinates. 2021-06-23 19:54:34 +01:00
Erwin Ried 8329b66926 Update credits 2021-06-22 12:44:19 +02:00
Erwin Ried 52376b12b2 Merge pull request #359 from XxOinvizioNxX/next
Add FrequencyStepView field to the TransmitterView class
2021-06-22 12:30:59 +02:00
Erwin Ried 95f72991c4 Merge pull request #367 from teixeluis/hotfix-rx-hang-issue-365
Added fix in the scope of issue #365
2021-06-22 12:29:51 +02:00
teixeluis 2ceb49e4f2 Added more precise function to calculate NL (based on cmath lib).
Created constants for some of the values scattered in the code.
2021-06-19 23:41:06 +01:00
Erwin Ried 8afd83a4e1 Merge pull request #381 from teixeluis/feature-radiosondes-beep-371
Radiosonde beep pitch RSSI improvements. Keeping current frequency in battery backed RAM
2021-06-17 21:48:14 +02:00
teixeluis 8aff0bb4d8 Improved tone generator for proper frequency control. Also
features a square wave mode.
Added proportional beep duration based on the RSSI as well.
Now reading the current radiosonde frequency from the
battery backed RAM instead starting with the same frequency
all the time.
2021-06-16 23:23:47 +01:00
Erwin Ried 7fe6a3b04e Merge pull request #379 from ArjanOnwezen/category-length-display-fix
fix save frequency gui glitch
2021-06-15 10:20:31 +02:00
Arjan Onwezen c8a8a69832 fix save frequency gui glitch 2021-06-14 21:58:15 +02:00
Erwin Ried de994d5911 Merge pull request #378 from ArjanOnwezen/adding-radiosonde-txt
Adding radiosonde txt
2021-06-14 21:10:10 +02:00
Arjan Onwezen 935db5b58b Added radiosonde.txt 2021-06-14 18:15:42 +02:00
Arjan Onwezen 81f7875764 Added radiosonde.txt 2021-06-14 18:10:45 +02:00
Erwin Ried 0f511508a3 Merge pull request #376 from teixeluis/feature-radiosondes-beep-371
Feature radiosondes beep - working pitch RSSI
2021-06-14 10:35:48 +02:00
teixeluis a80d91fb1e More improvements to the rssi tone. Added saving of the tuned frequency
to the radio model persistent store.
2021-06-13 23:35:33 +01:00
teixeluis 43e123bafe Used temporarily for experimental purposes, no longer needed. 2021-06-11 00:25:24 +01:00
teixeluis fb0672925e Merge remote-tracking branch 'portapack-mayhem/next' into feature-radiosondes-beep-371 2021-06-11 00:15:56 +01:00
teixeluis c2dc7d1cf5 Slight improvement of the tone generator. 2021-06-11 00:13:56 +01:00
teixeluis edcd780402 Improved the pitch RSSI. Still looking for better approach. 2021-06-10 12:10:24 +01:00
teixeluis c85e6a4d52 Now getting rssi events.Pitch changes still to be improved. 2021-06-09 09:10:01 +01:00
Erwin Ried 414ed9a0ec Merge pull request #374 from teixeluis/feature-radiosondes-beep-371
Feature radiosondes beep 371
2021-06-09 05:16:34 +02:00
teixeluis f8f5963bcf Merge remote-tracking branch 'portapack-mayhem/next' into feature-radiosondes-beep-371 2021-06-08 23:11:01 +01:00
teixeluis 9040e780bc Added beep on radiosonde packet decoding, and volume widget to control its level. 2021-06-08 23:07:37 +01:00
Erwin Ried f1ba8c3dee Merge pull request #361 from ArjanOnwezen/iso-date-time
ISO datetime for Clock, FileManager, Frequency manager, added clock UI options
2021-06-07 23:48:19 +02:00
Erwin Ried 3f1af56dfc Merge pull request #372 from ArjanOnwezen/fix-freq-manager-save-file
fix for freq manager save file
2021-06-07 23:47:00 +02:00
Arjan Onwezen 226c0c2d80 fix for freq manager save file 2021-06-06 01:31:30 +02:00
teixeluis d74e1830f8 Added fix in the scope of issue #365 2021-05-22 20:57:48 +01:00
Arjan Onwezen 6bc2cbeda9 ISO datetime for Clock, FileManager, Frequency manager
Added option to show/hide clock (with/without date)
2021-05-17 23:16:15 +02:00
Frey Hertz e76609a74a Update ui_transmitter.hpp 2021-05-14 23:00:09 +03:00
Frey Hertz 97f3f773fb FrequencyStepView field in TransmitterView class 2021-05-14 22:57:25 +03:00
Frey Hertz bf0b9b9881 FrequencyStepView field in TransmitterView class 2021-05-14 22:49:26 +03:00
Erwin Ried 182059b3c6 Merge pull request #358 from ArjanOnwezen/proc_aprsrc_cpp_warning_fix
proc_aprsrx.cpp compile warning fix
2021-05-12 12:40:47 +02:00
Arjan Onwezen c307e9d5ae proc_aprsrx.cpp compile warning fix 2021-05-12 08:09:04 +02:00
Erwin Ried a090f1fb0d Merge pull request #354 from ArjanOnwezen/ui_aprs_rx_cpp_warning_fix
ui_aprs_rx.cpp compiler warning fix
2021-05-12 02:20:55 +02:00
Erwin Ried 62b789e432 Merge pull request #353 from ArjanOnwezen/dsp_modulate_cpp_warning_fix
dsp_modulelate.cpp compiler warning fix
2021-05-12 02:20:17 +02:00
Erwin Ried 42b33c4526 Merge pull request #355 from ArjanOnwezen/aprs_packet_hpp_warning_fix
aprs_packet.hpp compiler warning fix
2021-05-12 02:19:57 +02:00
Erwin Ried a95c3a3e63 Merge pull request #357 from ArjanOnwezen/ui_adsb_rx_hpp_warning_fix
ui_adsb_rx.hpp compiler warning fix
2021-05-12 02:19:41 +02:00
Arjan Onwezen a3ef7d069e ui_adsb_rx.hpp compiler warning fix 2021-05-11 21:47:55 +02:00
Arjan Onwezen f5c3219035 aprs_packet.hpp compiler warning fix 2021-05-10 21:30:45 +02:00
Arjan Onwezen a2e4a15229 dsp.modulelate.cpp compiler warning fix 2021-05-10 19:31:48 +02:00
Arjan Onwezen 1a8319b86e /havoc/firmware/application/apps/ui_aprs_rx.cpp:51:7: warning: unused variable 'entry_age' [-Wunused-variable]
/havoc/firmware/application/apps/ui_aprs_rx.cpp:345:12: warning: unused variable 'age' [-Wunused-variable]
2021-05-10 16:28:46 +02:00
Erwin Ried 2ab4ed591d Update ui_about_simple.cpp 2021-05-03 04:00:39 +02:00
Erwin Ried 4f74e262d2 Merge pull request #351 from ArjanOnwezen/add-gsm-nl.txt
Added GSM-NL.txt contaning Dutch GSM frequencies
2021-05-03 03:59:38 +02:00
Arjan Onwezen 88ca1234d9 Added GSM-NL.txt contaning Dutch GSM frequencies 2021-05-02 18:54:33 +02:00
eried 433529b4cb Merge branch 'next' 2021-04-22 12:12:45 +02:00
eried f161e85f96 Merge branch 'next' of https://github.com/eried/portapack-mayhem into next 2021-04-22 12:11:52 +02:00
Erwin Ried f1fd9a3db1 Removing the warning
Does not applies anymore with the latest release
2021-04-22 12:11:32 +02:00
eried 85e4a43cbd Version bump 2021-04-22 09:34:52 +02:00
Erwin Ried 5f778c1734 Update ui_about_simple.cpp 2021-04-19 10:04:50 +02:00
Erwin Ried c19bcc17af Merge pull request #341 from fossum/feature/adding-snap-values-to-calls
Added a couple snap values to the calls app.
2021-04-19 10:04:07 +02:00
Eric Fossum d60299af95 Added a couple snap values to the calls app. 2021-04-17 22:20:28 +00:00
eried 57ed3ebb43 Merge branch 'pr/325' into next 2021-04-14 09:30:53 +02:00
eried dfa1a98575 Update hackrf 2021-04-14 09:29:45 +02:00
Erwin Ried e21fbbf234 Merge pull request #329 from aldude999/next
AM/SSB/DSB Microphone Functionality
2021-04-14 09:26:09 +02:00
Erwin Ried 136209dc8d Update ui_about_simple.cpp 2021-04-14 09:25:38 +02:00
Erwin Ried 838451f491 Merge pull request #339 from eried/recognition-of-audio-chip
Recognition of audio chip
2021-04-14 09:24:46 +02:00
Erwin Ried 2da482f393 Merge pull request #336 from RedFox-Fr/next
Updates to somes files in sdcard/FREQMAN
2021-04-14 09:22:07 +02:00
Erwin Ried 4cafce3286 Merge pull request #337 from eried/update-hackrf-submodule
Update hackrf submodule
2021-04-14 09:21:36 +02:00
RedFox-Fr f9685517ea Update somes sdcard/FREQMAN files 2021-04-14 00:54:10 +02:00
RedFox-Fr d020016413 Update somes sdcard/FREQMAN files. 2021-04-14 00:45:13 +02:00
Erwin Ried 4c50401df2 Update ui_about_simple.cpp 2021-04-12 13:29:01 +02:00
Erwin Ried d57edd5e25 Merge pull request #333 from zhang00963/next
Automatic recognition of audio chip patch
2021-04-12 12:47:34 +02:00
eried 594890744b New GSM-FR.TXT file for sdcard/FREQMAN
https: //github.com/eried/portapack-mayhem/issues/334
Co-Authored-By: RedFox-Fr <82333326+RedFox-Fr@users.noreply.github.com>
2021-04-12 12:46:34 +02:00
zhang00963 a0eaa70ff4 Realize the automatic recognition of audio chip, including ak4951en/wm8731/wm8731s,Try to fix the max2837 temperature problem 2021-04-11 02:19:31 +08:00
eried 9402634602 Update hackrf 2021-03-25 14:50:22 +01:00
Erwin Ried 41864f06e7 Delete ui_mictx.cpp.1 2021-03-22 10:10:01 +01:00
Erwin Ried 133bfbf07b Delete ui_mictx.hpp.1 2021-03-22 10:09:41 +01:00
DESKTOP-R56EVJP\Alex f65852ff05 Rebased code from new eried repo commits. Changed to to reflect strijar implementation. Fixed previous issue with old ssb-am-tx ui_mictx code. 2021-03-21 20:21:50 -05:00
Erwin Ried 603b7fb1ab Merge pull request #286 from GullCode/ui_looking_glass_warning_fix
Fixed redefined define, possibly overflowing variable, missing constructors
2021-03-16 14:46:23 +01:00
Erwin Ried 9d437aee6a Merge pull request #278 from GullCode/tv_collector_warning_fix
removed unused variables
2021-03-15 11:45:50 +01:00
Erwin Ried fe98a58a4f Merge pull request #277 from GullCode/adsb_warning_fix
Fix adsb warnings
2021-03-15 11:45:32 +01:00
Erwin Ried ee2ebc8302 Merge pull request #272 from euquiq/RADIOSONDE_METEOMAN_LAT_LON_BUG_FIX
Fix bug on radiosonde Meteoman Lat & lon calculation
2021-03-15 11:44:21 +01:00
East2West f15cf78101 Add APRS Receiving App 2021-03-11 22:27:19 -06:00
Erwin Ried f56e8930dc Update dockerfile 2021-03-11 10:34:10 +01:00
Erwin Ried f98c96e98a Update dockerfile-nogit 2021-03-11 10:33:54 +01:00
Erwin Ried de92faf67b Same as the other dockerfile, using get-pip.py 3.4
https://stackoverflow.com/questions/65896334/python-pip-broken-wiith-sys-stderr-writeferror-exc
2021-02-16 09:50:34 +01:00
Erwin Ried 27f354f841 Latest pip broken
https://stackoverflow.com/questions/65896334/python-pip-broken-wiith-sys-stderr-writeferror-exc
2021-02-16 09:49:48 +01:00
Erwin Ried eca25898f2 Merge pull request #276 from GullCode/chibios_warning_fix
Fix warning: cast between incompatible function types
2021-02-16 09:12:22 +01:00
Erwin Ried aea807e1f4 Merge pull request #280 from GullCode/proc_am_audio_warning_fix
Quoted out unused variable
2021-02-16 09:11:20 +01:00
Erwin Ried 8807ab179b Merge pull request #283 from GullCode/proc_btlerx_warning_fix
Quoted CRC calculus as it's unused, voided message
2021-02-16 09:10:42 +01:00
Erwin Ried 7049373d67 Merge pull request #288 from GullCode/ui_navigation_warning_fix
Added missing brace
2021-02-16 09:10:08 +01:00
Erwin Ried 3c30c127e2 Update ui_navigation.cpp 2021-02-16 09:09:49 +01:00
Erwin Ried b82b0f15d0 Merge pull request #311 from ImDroided/next
Added Pocsag bitrate
2021-02-15 09:52:15 +01:00
ImDroided 62c1e4e028 Added Pocsag bitrate
I added 3200 to the bitrates in pocsag per a user request on Facebook.
2021-02-14 12:52:56 -06:00
GullCode cd8732c24f Direct casting to int instead of new var 2021-02-05 23:08:54 +01:00
Erwin Ried 4f90c5efee Updating contributors list 2021-02-03 22:23:12 +01:00
Erwin Ried e0e57e5af2 Merge pull request #290 from GullCode/ui_tv_warning_fix
removed unused var
2021-02-03 22:20:34 +01:00
Erwin Ried d59b0d44d3 Merge pull request #282 from GullCode/proc_am_tv_warning_fix
Quoted unused vars and voided one
2021-02-03 22:09:06 +01:00
Erwin Ried 5ca7398bd9 Merge pull request #279 from GullCode/proc_capture_warning_fix
fix unused result
2021-02-03 22:08:43 +01:00
Erwin Ried dbb46edcb6 Merge pull request #285 from GullCode/proc_nrfrx_warning_fix
Removed unused and voided a var
2021-02-03 22:07:58 +01:00
Erwin Ried 68e75cc98e Merge pull request #293 from GullCode/ui_scanner_warning_fix
Fixed uninitialized / missing switch cases, unused
2021-02-03 22:07:13 +01:00
Erwin Ried f0ca95ee7e Merge pull request #274 from GullCode/sonde_packet_warning_fix
Moved calibytes and calfrchk to cpp file to avoid unused warning
2021-02-03 22:06:27 +01:00
GullCode 1a48fb8c5a removed a var, added a void, removed a unused initializer 2021-01-28 10:08:57 +01:00
Erwin Ried 1a3a60f6ac Merge pull request #281 from GullCode/proc_audio_tx_warning_fix
Added missing initialisation
2021-01-28 00:23:42 +01:00
Erwin Ried 77a7f48958 Merge pull request #284 from GullCode/proc_pocsag_warning_fix
Added missing initialisations
2021-01-28 00:23:10 +01:00
Erwin Ried 523877e0d1 Merge pull request #287 from GullCode/ais_packet_warning_fix
Added missing default constructor
2021-01-28 00:22:37 +01:00
Erwin Ried 282416169d Merge pull request #289 from GullCode/ertkey_warning_fix
Added missing default constructor
2021-01-28 00:18:31 +01:00
Erwin Ried 8e8e156477 Merge pull request #291 from GullCode/ui_fileman_warning_fix
Added a voided v
2021-01-28 00:16:40 +01:00
Erwin Ried b1135aab0a Merge pull request #292 from GullCode/ui_morse_warning_fix
added a voided var
2021-01-28 00:16:27 +01:00
Erwin Ried 36f9e0cb7c Merge pull request #294 from GullCode/ui_settings_warning_fix
Added missing initializer
2021-01-28 00:16:07 +01:00
Erwin Ried 9bd74f32d0 Merge pull request #295 from GullCode/ui_sonde_warning_fix
Added missing initializer
2021-01-28 00:15:39 +01:00
Erwin Ried dd0042b5f1 Merge pull request #297 from GullCode/soundboard_app_warning_fix
added a voided var
2021-01-28 00:14:55 +01:00
GullCode fb61ad55c0 added a voided var 2021-01-27 17:20:07 +01:00
GullCode ca7b5e110c Added missing initializer 2021-01-27 17:10:37 +01:00
GullCode a6a41ca5a5 Added missing initialize 2021-01-27 17:08:09 +01:00
GullCode 02d69e54eb Fixed uninitialized / missing switch cases, unused 2021-01-27 17:03:20 +01:00
GullCode b75ef345a5 added a voided var 2021-01-27 16:57:42 +01:00
GullCode 8c84719598 Added two voided vars 2021-01-27 16:54:17 +01:00
GullCode 8bfeba0d89 Added a voided v 2021-01-27 16:50:48 +01:00
GullCode c3c680fc04 removed unused var 2021-01-27 16:46:58 +01:00
GullCode f0457c106d Added missing default constructor 2021-01-27 16:43:13 +01:00
GullCode 5d73175a17 Added missing brace 2021-01-27 16:39:50 +01:00
GullCode 45b874694e Added missing default constructor 2021-01-27 16:36:44 +01:00
GullCode 42113434f0 Fixed redefined define, possibly overflowing variable, missing constructors 2021-01-27 16:30:09 +01:00
GullCode e9e4d20302 Removed unused and voided a var 2021-01-27 16:11:20 +01:00
GullCode ec520bf08c Added missing initialisations 2021-01-27 16:07:03 +01:00
GullCode 486c1d6bcd Quoted CRC calculus as it's unused, voided message 2021-01-27 16:02:59 +01:00
GullCode b7eb095dd8 Quoted unused vars and voided one 2021-01-27 15:58:56 +01:00
GullCode 3c14d38286 Added missing initialisation 2021-01-27 15:54:45 +01:00
GullCode 3166a66756 Quoted out unused variable 2021-01-27 15:52:17 +01:00
GullCode 961e115cc6 fix unused result 2021-01-27 15:48:41 +01:00
GullCode 1483160df4 removed unused variables 2021-01-27 15:45:04 +01:00
GullCode c3fe053eb2 Fix adsb warnings 2021-01-27 15:38:05 +01:00
GullCode 6c2950cfe8 Fix warning: cast between incompatible function types from 'void (*)(void *)' to 'msg_t (*)(void *)' 2021-01-27 15:32:46 +01:00
Erwin Ried 89d46d59ee Merge pull request #275 from GullCode/channel_stat_collector_warning_fix
Fix __SIMD32 warning
2021-01-27 15:22:39 +01:00
Erwin Ried 0d7aa1d32c Merge pull request #273 from GullCode/spi_image_warning_fix
missing contructor
2021-01-27 15:17:42 +01:00
GullCode 266e398224 Fix __SIMD32 warning 2021-01-27 15:16:43 +01:00
GullCode e75677d366 Moved calibytes and calfrchk to cpp file to avoid unused warning 2021-01-27 15:09:02 +01:00
GullCode 1c1d3e9897 missing contructor 2021-01-27 14:57:22 +01:00
euquiq 50bab791dd Fix bug on radiosonde Meteoman Lat & lon calculation
The underlying function used for calculating Latitude and Longitude -also used in other places inside the radiosonde app- was returning a positive value always.

But it needs to cope with negative values also (i.e. Lat and Lon)

Fixed by just changing the returning value into int32_t (even if the calculation is done in uint32_t, the actual sign is passed thru when returning the calculated value -those are the same 4 bytes, interpreted either as (before) unsigned or (now) signed)
2021-01-25 23:41:19 -03:00
Erwin Ried 19ebf14e8c Update README.md 2021-01-20 11:03:39 +01:00
eried 8b6442ee79 Merge branch 'next' 2021-01-20 10:53:24 +01:00
eried 456b55d552 Merge branch 'next' of https://github.com/eried/portapack-mayhem into next 2021-01-20 10:52:56 +01:00
Erwin Ried 3dfb23481f Update README.md 2021-01-20 10:29:13 +01:00
eried 000b2d3e7d Version bump 2021-01-20 10:02:52 +01:00
Erwin Ried faa4affba1 Update README.md 2021-01-20 09:42:21 +01:00
Erwin Ried 099afda51c Update README.md 2021-01-20 09:41:25 +01:00
Erwin Ried 5c09efe8f6 Update README.md 2021-01-20 08:33:58 +01:00
Erwin Ried 157f08bc49 Update README.md 2021-01-20 08:32:27 +01:00
Erwin Ried d5e6d9d662 Merge pull request #257 from strijar/waterfall-bar
Waterfall filter bar
2021-01-12 21:57:19 +01:00
Erwin Ried 64bdd3e018 Merge pull request #263 from euquiq/JAMMER-TX_COOLDOWN_TIMERS_IN_SECONDS
JAMMER NOW INCLUDES TWO TIMERS
2021-01-12 21:57:04 +01:00
euquiq 928bce083a Cosmetics + Jammer now in green + Jitter
I think the Jammer deserves a green icon, since it actually does it job pretty well.

Then there is a Jitter parameter. It allows to introduce a jitter from 1/60th of a second up to 60/60th of a second (a full one). It will delay / move forward either the TX or the cooldown period for a maximum of a half of the time you choose as jitter.

Meaning: If I choose 60/60th, a full second of jitter, it will produce a random number from 1 to 60.

Then it will calculate jitter = 30 - randomnumber

THen it will "add" that (positive or negative) time to the  time counter for the next jitter change of state.
2021-01-08 11:54:21 -03:00
euquiq 8859c3d80c JAMMER NOW INCLUDES TWO TIMERS
Each driving the TX and COOLDOWN timers.
2021-01-07 17:51:38 -03:00
Белоусов Олег 1e9406d091 Cleaned up a bit 2020-12-24 11:14:23 +03:00
Белоусов Олег 63f6a885d8 Implemented correct display of the filter indicator on the waterfall 2020-12-23 18:00:51 +03:00
Erwin Ried 608c8c3597 Merge pull request #222 from euquiq/simplify-persistent-memory-ui-config
just making Persistent Memory easier to read
2020-11-23 12:05:07 +01:00
euquiq 6aee1c9c30 just making Persistent Memory easier to read
Some internal code re-writing in order to simplify a bit, and hopefully making it easier to understand what's going on inside there.
2020-11-03 02:14:16 -03:00
Erwin Ried 95be75a8af Merge pull request #172 from dqs105/new_splash
New custom splash.
2020-09-14 22:53:59 +02:00
dqs105 5cbbf62c5f Removed drawRAW.
- BMP files can be loaded directly now, so it can be removed.
2020-08-29 10:53:26 +08:00
dqs105 80f074b82f Added BMP file support.
- Now can load splash.bmp!
2020-08-28 12:23:52 +08:00
dqs105 7116ca3f91 Fixed typo. 2020-08-28 00:27:52 +08:00
dqs105 8463cba4b6 Splash generator.
(Modified from the one generates world_map.bin)
2020-08-28 00:22:36 +08:00
dqs105 78f2e417d6 Fixed RGB565 mode & clean up 2020-08-28 00:21:09 +08:00
dqs105 ac12bf5f50 modify file extension from data to bin. 2020-08-27 23:16:05 +08:00
dqs105 8edaa1e51e Added new custom splash.
- Custom splash now can be loaded from SD card.
2020-08-27 23:07:48 +08:00
414 changed files with 530405 additions and 7271 deletions
+1
View File
@@ -0,0 +1 @@
build
+10 -4
View File
@@ -1,12 +1,18 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a report to help us improve the software
title: ''
labels: bug
assignees: ''
---
----
(Please try the latest nightly release before submitting this. You can find the latest nightly version here: https://github.com/eried/portapack-mayhem/releases)
----
**Describe the bug**
A clear and concise description of what the bug is.
@@ -21,9 +27,9 @@ A clear and concise description of what you expected to happen.
**Affected versions**
Please write any difference related with the Expected behavior, on the following versions:
* Latest Stable Release
* Previous one (if any) that did not presented the issue
* Old versions available here: https://github.com/eried/Research/tree/master/HackRF/PortaPack/old_legacy_firmware
* Latest Stable release:
* Latest Nightly release:
* Previous working release:
**Additional**
If the bug is difficult to explain, additionally to the text please include images and videos.
@@ -1,18 +1,39 @@
---
name: Problem upgrading the firmware
about: Deal with the firmware upgrade problems
title: Problem upgrading the firmware
labels: ''
name: Problem upgrading the firmware or booting
about: If you are having firmware upgrade or booting problems
title: ''
labels: 'firmware'
assignees: ''
---
**What is happening?**
Describe here why you are unable to upgrade the firmware. Before describing your problems, **do the following**:
----
Before creating this issue, **do the following**:
* Read the Wiki on booting: https://github.com/eried/portapack-mayhem/wiki/Won't-boot
* Read: https://github.com/eried/portapack-havoc/wiki/Update-firmware
* Watch carefully: https://www.youtube.com/watch?v=_zx4ZvurgOs
* (if you are not in Windows) also check: https://www.youtube.com/watch?v=kjFB58Y1TAo
----
**Describe the issue**
A clear and concise description of what the issue you are facing is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Tap on '....'
**My Hardware**
Please specify what PortaPack hardware version you are using.
You can find the list of versions here: https://github.com/eried/portapack-mayhem/wiki/PortaPack-Versions
**Affected versions**
Please tell us what version you are running.
If your device is still functional, try the latest nightly release before submitting this.
You can find the latest nightly version here https://github.com/eried/portapack-mayhem/releases
**Were you able to update the firmware before?**
Things might be confusing the first time, please check the video available on the link above.
@@ -20,4 +41,4 @@ Things might be confusing the first time, please check the video available on th
If is possible, swap hardware and try again. Also, try different USB cables, even if the one you are using works fine for other purposes.
**Additional**
Add photos and videos of your procedure.
If the issue is difficult to explain, additionally to the text please include images and videos.
+28
View File
@@ -0,0 +1,28 @@
import os
import re
import sys
raw_git = os.popen('git log next --since="24 hours" --pretty=format:"- %h - {USERNAME}*+%al-%an*: %s"').read()
def compute_username(line):
stripped = re.search(r'(?<=\*)(.*?)(?=\*)', line).group(0)
pattern = re.compile("[$@+&?].*[$@+&?]")
if pattern.match(stripped):
stripped = re.sub("[$@+&?].*[$@+&?]", "", stripped)
stripped = re.match(r'.+?(?=-)', stripped).group(0)
else:
stripped = re.sub(r'^.*?-', "", stripped)
return "@" + stripped
def compile_line(line):
username = compute_username(line)
line = re.sub(r'[*].*[*]', "", line)
line = line.replace("{USERNAME}", username)
return line
for row in raw_git.splitlines():
print(compile_line(row))
@@ -0,0 +1,99 @@
name: Nightly Release
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v2
- name: print latest_commit
run: echo ${{ github.sha }}
- name: check latest commit is less than a day
id: should_run
continue-on-error: true
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
build:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Get version date
id: version_date
run: echo "::set-output name=date::n_$(date +'%y%m%d')"
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
ref: next
submodules: true
- name: Git Sumbodule Update
run: |
git submodule update --init --recursive
- name: Build the Docker image
run: docker build -t portapack-dev -f dockerfile-nogit . --tag my-image-name:$(date +%s)
- name: Make build folder
run: mkdir ${{ github.workspace }}/build
- name: Run the Docker image
run: docker run -e VERSION_STRING=${{ steps.version_date.outputs.date }} -i -v ${{ github.workspace }}:/havoc portapack-dev
- name: Create Firmware ZIP
run: |
zip -j firmware.zip build/firmware/portapack-h1_h2-mayhem.bin && cd flashing && zip -r ../firmware.zip *
- name: Create SD Card ZIP
run: |
zip -r sdcard.zip sdcard
- name: Create changelog
run: |
CHANGELOG=$(python3 .github/workflows/changelog.py)
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=content::$CHANGELOG"
id: changelog
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly-tag-${{ steps.date.outputs.date }}
release_name: Nightly Release - ${{ steps.date.outputs.date }}
body: |
**Nightly release - ${{ steps.date.outputs.date }}**
This build is the latest and greatest, although may not be the most stable as this is a nightly release.
## Release notes
### Revision (${{ steps.version_date.outputs.date }}):
${{ steps.changelog.outputs.content }}
draft: false
prerelease: true
- name: Upload Firmware Asset
id: upload-firmware-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware.zip
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_FIRMWARE.zip
asset_content_type: application/zip
- name: Upload SD Card Assets
id: upload-sd-card-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sdcard.zip
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_COPY_TO_SDCARD.zip
asset_content_type: application/zip
@@ -0,0 +1,93 @@
name: Stable Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
ref: next
submodules: true
- name: Git Sumbodule Update
run: |
git submodule update --init --recursive
- name: Get version
id: version
run: echo "::set-output name=version::$(cat .github/workflows/version.txt)"
- name: Get past version
id: past_version
run: echo "::set-output name=past_version::$(cat .github/workflows/past_version.txt)"
- name: Build the Docker image
run: docker build -t portapack-dev -f dockerfile-nogit . --tag my-image-name:$(date +%s)
- name: Make build folder
run: mkdir ${{ github.workspace }}/build
- name: Run the Docker image
run: docker run -e VERSION_STRING=${{ steps.version.outputs.version }} -i -v ${{ github.workspace }}:/havoc portapack-dev
- name: Create Firmware ZIP
run: |
zip -j firmware.zip build/firmware/portapack-h1_h2-mayhem.bin && cd flashing && zip -r ../firmware.zip *
- name: Create SD Card ZIP
run: |
zip -r sdcard.zip sdcard
- name: Create changelog
run: |
CHANGELOG=$(python3 .github/workflows/stable_changelog.py ${{ steps.past_version.outputs.past_version }})
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=content::$CHANGELOG"
id: changelog
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: Mayhem firmware ${{ steps.version.outputs.version }}
body: |
**Stable release - ${{ steps.version.outputs.version }}**
This is a fork of the [Havoc](https://github.com/furrtek/portapack-havoc/) firmware, which itself was a fork of the [PortaPack](https://github.com/sharebrained/portapack-hackrf) firmware, an add-on for the [HackRF](http://greatscottgadgets.com/hackrf/). Please check the [readme](https://github.com/eried/portapack-mayhem/blob/master/README.md) for details.
## Release notes
### Revision (${{ steps.version.outputs.version }}):
${{ steps.changelog.outputs.content }}
**Full Changelog**: https://github.com/eried/portapack-mayhem/compare/${{ steps.past_version.outputs.past_version }}...${{ steps.version.outputs.version }}
## Installation
Check the [wiki](https://github.com/eried/portapack-havoc/wiki/Update-firmware) for details how to upgrade.
### MicroSD card files
For certain functionality, like the world map, GPS simulator, and others you need to uncompress (using [7-zip](https://www.7-zip.org/download.html)) the files from `mayhem_vX.Y.Z_COPY_TO_SDCARD.zip` to a FAT32 formatted MicroSD card.
draft: true
prerelease: false
- name: Upload Firmware Asset
id: upload-firmware-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware.zip
asset_name: mayhem_${{ steps.version.outputs.version }}_FIRMWARE.zip
asset_content_type: application/zip
- name: Upload SD Card Assets
id: upload-sd-card-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sdcard.zip
asset_name: mayhem_${{ steps.version.outputs.version }}_COPY_TO_SDCARD.zip
asset_content_type: application/zip
+1
View File
@@ -0,0 +1 @@
v1.6.0
+30
View File
@@ -0,0 +1,30 @@
import os
import re
import sys
past_version = sys.argv[1]
raw_git = os.popen('git log ' + past_version + '..next --pretty=format:"- %h - {USERNAME}*+%al-%an*: %s"').read()
def compute_username(line):
stripped = re.search(r'(?<=\*)(.*?)(?=\*)', line).group(0)
pattern = re.compile("[$@+&?].*[$@+&?]")
if pattern.match(stripped):
stripped = re.sub("[$@+&?].*[$@+&?]", "", stripped)
stripped = re.match(r'.+?(?=-)', stripped).group(0)
else:
stripped = re.sub(r'^.*?-', "", stripped)
return "@" + stripped
def compile_line(line):
username = compute_username(line)
line = re.sub(r'[*].*[*]', "", line)
line = line.replace("{USERNAME}", username)
return line
for row in raw_git.splitlines():
print(compile_line(row))
+1
View File
@@ -0,0 +1 @@
v1.7.0
+4 -3
View File
@@ -27,7 +27,6 @@
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
@@ -39,7 +38,6 @@
*.lib
# Executables
*.exe
*.out
*.app
/firmware/baseband/*.bin
@@ -66,4 +64,7 @@ CMakeFiles/
/firmware/CMakeCache.txt
# Python env
env/
env/
# Other
*.bak
-1
View File
@@ -53,4 +53,3 @@ addons:
- sed
- cmake
- dfu-util
+4 -4
View File
@@ -25,8 +25,8 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/firmware/toolchain-arm-cortex
project(portapack-h1)
#set(VERSION "")
if (NOT DEFINED VERSION)
set(VERSION "$ENV{VERSION_STRING}")
if ("$ENV{VERSION_STRING}" STREQUAL "")
execute_process(
COMMAND git log -n 1 --format=%h
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
@@ -38,14 +38,14 @@ if (NOT DEFINED VERSION)
if (GIT_VERSION_FOUND)
set(VERSION "unknown")
else (GIT_VERSION_FOUND)
set(VERSION "local-${GIT_VERSION}")
set(VERSION "${GIT_VERSION}")
endif (GIT_VERSION_FOUND)
endif()
set(LICENSE_PATH ${CMAKE_CURRENT_LIST_DIR}/LICENSE)
set(HARDWARE_PATH ${CMAKE_CURRENT_LIST_DIR}/hardware)
add_subdirectory(hackrf/firmware/hackrf_usb)
add_subdirectory(hackrf-portapack)
set(HACKRF_FIRMWARE_DFU_FILENAME hackrf_usb.dfu)
set(HACKRF_FIRMWARE_BIN_FILENAME hackrf_usb_ram.bin)
+587 -252
View File
@@ -1,281 +1,622 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
TERMS AND CONDITIONS
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
0. Definitions.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
"This License" refers to version 3 of the GNU General Public License.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
A "covered work" means either the unmodified Program or a work based
on the Program.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
1. Source Code.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
The Corresponding Source for a work in source code form is that
same work.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
2. Basic Permissions.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
14. Revised Versions of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+339
View File
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+7
View File
@@ -0,0 +1,7 @@
# License
Portapack Mayhem is distributed under [GPL v3.0](LICENSE), however some sub projects might have different (GPL v3.0 compatible) licenses.
## Other Licenses (compatible with GPL v3.0)
- Most of Portapack Mayhem is distributed under GPL-2.0-or-later. [license](LICENSE.GPL-2.0-or-later)
- ChibiOS is distributed under GPL v3.0. [license](/firmware/chibios/license.txt)
- Portapack-ChibiOS is distributed under Apache-2.0 [license](http://www.apache.org/licenses/LICENSE-2.0)
+19 -22
View File
@@ -1,12 +1,12 @@
# PortaPack Mayhem
[![Build Status](https://travis-ci.com/eried/portapack-mayhem.svg?branch=master)](https://travis-ci.com/eried/portapack-mayhem) [![buddy pipeline](https://app.buddy.works/eried/portapack/pipelines/pipeline/252276/badge.svg?token=48cd59d53de0589a8fbe26bc751d77a59a011cf72581da049343879402991c34 "buddy pipeline")](https://app.buddy.works/eried/portapack/pipelines/pipeline/252276) [![CodeScene Code Health](https://codescene.io/projects/8381/status-badges/code-health)](https://codescene.io/projects/8381) [![GitHub All Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/total)](https://github.com/eried/portapack-mayhem/releases) [![GitHub Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/latest/total)](https://github.com/eried/portapack-mayhem/releases/latest) [![Docker Hub Pulls](https://img.shields.io/docker/pulls/eried/portapack.svg)](https://hub.docker.com/r/eried/portapack) [![Discord Chat](https://img.shields.io/discord/719669764804444213.svg)](https://discord.gg/tuwVMv3) [![Check bounties!](https://img.shields.io/bountysource/team/portapack-mayhem/activity?color=%2333ccff&label=bountysource%20%28USD%29&style=plastic)](https://www.bountysource.com/teams/portapack-mayhem/issues)
[![Build Status](https://travis-ci.com/eried/portapack-mayhem.svg?branch=master)](https://travis-ci.com/eried/portapack-mayhem) [![Nightly Release](https://github.com/eried/portapack-mayhem/actions/workflows/create_nightly_release.yml/badge.svg?branch=next)](https://github.com/eried/portapack-mayhem/actions/workflows/create_nightly_release.yml) [![CodeScene Code Health](https://codescene.io/projects/8381/status-badges/code-health)](https://codescene.io/projects/8381) [![GitHub All Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/total)](https://github.com/eried/portapack-mayhem/releases) [![GitHub Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/latest/total)](https://github.com/eried/portapack-mayhem/releases/latest) [![Docker Hub Pulls](https://img.shields.io/docker/pulls/eried/portapack.svg)](https://hub.docker.com/r/eried/portapack) [![Discord Chat](https://img.shields.io/discord/719669764804444213.svg)](https://discord.gg/tuwVMv3) [![Check bounties!](https://img.shields.io/bountysource/team/portapack-mayhem/activity?color=%2333ccff&label=bountysource%20%28USD%29&style=plastic)](https://www.bountysource.com/teams/portapack-mayhem/issues)
This is a fork of the [Havoc](https://github.com/furrtek/portapack-havoc/) firmware, which itself was a fork of the [PortaPack](https://github.com/sharebrained/portapack-hackrf) firmware, an add-on for the [HackRF](http://greatscottgadgets.com/hackrf/). A fork is a derivate, in this case one that has extra features and fixes when compared to the older versions.
[<img src="https://raw.githubusercontent.com/wiki/eried/portapack-mayhem/img/hw_overview_h2_front.png" height="400">](https://github.com/eried/portapack-mayhem/wiki/Hardware-overview) [<img src="https://raw.githubusercontent.com/wiki/eried/portapack-mayhem/img/hw_overview_h2_inside.png" height="400">](https://github.com/eried/portapack-mayhem/wiki/Hardware-overview#portapack-internals)
*[PortaPack H2+HackRF+battery](https://s.click.aliexpress.com/e/_dZ7lA96) (clone) with a custom [3d printed case](https://github.com/eried/portapack-mayhem/wiki/H2-Enclosure)*
*[PortaPack H2+HackRF+battery](https://s.click.aliexpress.com/e/_DmU7GQX) (clone) with a custom [3d printed case](https://github.com/eried/portapack-mayhem/wiki/H2-Enclosure)*
# Quick overview
@@ -18,40 +18,40 @@ If you are new to *HackRF+PortaPack+Mayhem*, there is an awesome introductory vi
This repository expands upon the previous work by many people and aims to constantly add new features, bugfixes and generate documentation to make further development easier. [Collaboration](https://github.com/eried/portapack-mayhem/wiki/How-to-collaborate) is always welcomed and appreciated.
## Does it work on H1/H2 PortaPack?
## What to buy?
Yes, both devices are the [same](https://github.com/eried/portapack-mayhem/wiki/First-steps). The one I am using to test all changes is this [PortaPack H2+HackRF+battery](https://s.click.aliexpress.com/e/_dZ7lA96), which is a kit that includes everything you need. Sadly, the people making the H2 never made the updated schematics available, which is not ideal (and goes against the terms of the license). Most members of the community are using a clone of the [PortaPack H1+HackRF+metal case](https://s.click.aliexpress.com/e/_dS6liw4), which does not include any battery functionality, but it is a cheaper alternative.
:heavy_check_mark: A recommended one is this [PortaPack H2](https://s.click.aliexpress.com/e/_DmU7GQX) pack, that includes everything you need. Sadly, the people making the H2 never made the updated schematics available (against the terms of the license).
To support the people behind the hardware, please buy a genuine [HackRF](https://greatscottgadgets.com/hackrf/) and [PortaPack](https://store.sharebrained.com/products/portapack-for-hackrf-one-kit).
:heavy_check_mark: Another popular option is the clone of the [PortaPack H1](https://s.click.aliexpress.com/e/_Dkbqs2X).
## Where is the latest firmware?
:warning: Be cautious , *ask* the seller about compatibility with the latest releases. Look out for the description of the item, if they provide the firmware files for an older version or they have custom setup instructions, this means it might be **NOT compatible**, for example:
The current stable release is on the [![GitHub release (latest by date)](https://img.shields.io/github/v/release/eried/portapack-mayhem?label=Releases&style=social)](https://github.com/eried/portapack-mayhem/releases/latest) page. Follow the instructions you can find in the release description. There is also [nightly builds](https://github.com/eried/portapack-mayhem/releases/tag/nightly) generated periodically, which include the latest commits, but they may contain incomplete or buggy functionality.
![image](https://user-images.githubusercontent.com/1091420/214579017-9ad970b9-0917-48f6-a550-588226d3f89b.png)
## Is this the newest firmware for my PortaPack?
Most probably: **YES**. *If you find new features somewhere else, please [suggest](https://github.com/eried/portapack-mayhem/issues/new/choose) them*.
:warning: If it looks **too different**, this might mean that they are using their own recipe, check the [different models](https://github.com/eried/portapack-mayhem/wiki/PortaPack-Versions) in our wiki. For example all the H3 and clones of that version use their own version of the firmware. They do not contribute the changes back and eventually you will be left with a device that nobody maintains:
## Which one is actually the newest?
There is a lot of confusion of which is the latest version because no old version used any actual "version number". Additionally, since the files were distributed on facebook groups, github issue links and similar temporal sources, then there was no central location for them.
![image](https://user-images.githubusercontent.com/1091420/214581333-424900ee-26f8-4e96-be2f-69d8dc995ba9.png)
This fork (**Mayhem**) uses *major.minor.release* [semantic versioning](https://en.wikipedia.org/wiki/Software_versioning), so you can always compare your current version with the latest from [Releases](https://github.com/eried/portapack-mayhem/releases/latest).
## Where is the latest version?
## What about Havoc/GridRF/jamesshao8/jboone's?
* jboone's PortaPack: the [vanilla](https://en.wikipedia.org/wiki/Vanilla_software) experience
* Havoc: It was the most popular fork of jboone's PortaPack, currrently, it is not being maintained nor updated
* jamesshao8: He keeps his own version of the fork, while not attached as a fork to anything
* GridRF: They sell PortaPack clones with their own firmware based on a old version, which has no sourcecode available
The current **stable release** is on the [![GitHub release (latest by date)](https://img.shields.io/github/v/release/eried/portapack-mayhem?label=Releases&style=social)](https://github.com/eried/portapack-mayhem/releases/latest) page. Follow the instructions you can find in the release description. The **latest (nightly) release** can be found [here](https://github.com/eried/portapack-mayhem/releases/).
## How can I collaborate
You can write [documentation](https://github.com/eried/portapack-mayhem/wiki), fix bugs and [answer issues](https://github.com/eried/portapack-mayhem/issues) or add new functionality. Please check the following [guide](https://github.com/eried/portapack-mayhem/wiki/How-to-collaborate) with details.
Consider that the hardware and firmware has been created and maintain by a [lot](https://github.com/mossmann/hackrf/graphs/contributors) of [people](https://github.com/eried/portapack-mayhem/graphs/contributors), so always try colaborating your time and effort first. For coding related questions, if something does not fit as an issue, please join our Discord by clicking the chat badge on [top](#portapack-mayhem).
Consider that the hardware and firmware has been created and maintain by a [lot](https://github.com/mossmann/hackrf/graphs/contributors) of [people](https://github.com/eried/portapack-mayhem/graphs/contributors), so always try collaborating your time and effort first. For coding related questions, if something does not fit as an issue, please join our Discord by clicking the chat badge on [top](#portapack-mayhem).
[![Contributors](https://contrib.rocks/image?repo=eried/portapack-mayhem)](https://github.com/eried/portapack-mayhem/graphs/contributors)
To support the people behind the hardware, please buy a genuine [HackRF](https://greatscottgadgets.com/hackrf/) and [PortaPack](https://store.sharebrained.com/products/portapack-for-hackrf-one-kit).
As a last option, if you want to send money directly to me for getting more boards, antennas and such:
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CBPQA4HRRPJQ6&source=url)
## What if I really want to pay for something?
## What if I really want something specific?
If what you need can be relevant in general, you can [request a feature](https://github.com/eried/portapack-mayhem/issues/new?labels=enhancement&template=feature_request.md).
You can create a bounty and invite people to your own bounty. This will incentivize coders to work on a new feature, solving a bug or even writting documentation. Start a bounty by [creating](https://github.com/eried/portapack-mayhem/issues/new/choose) or [choosing](https://github.com/eried/portapack-mayhem/issues/) an existing issue. Then, go to [Bountysource](https://www.bountysource.com/) and post a bounty using the link to that specific [issue](https://www.bountysource.com/teams/portapack-mayhem/issues).
Promote your bounty over our Discord by clicking the chat badge on [top](#portapack-mayhem).
@@ -60,6 +60,3 @@ Promote your bounty over our Discord by clicking the chat badge on [top](#portap
First, check the [documentation](https://github.com/eried/portapack-mayhem/wiki). If you find a bug or you think the problem is related to the current repository, please open an [issue](https://github.com/eried/portapack-mayhem/issues/new/choose).
You can reach the [official community](https://www.facebook.com/groups/177623356165819) in Facebook, and our Discord by clicking the chat badge on [top](#portapack-mayhem).
## What if I find incongruencies, or grammatical errors in the text?
If is on the [Wiki](https://github.com/eried/portapack-mayhem/wiki), you can modify it directly. If is on files of the repository, you can send corrections as [pull requests](https://github.com/eried/portapack-mayhem/wiki/How-to-collaborate#coding-new-stuff-or-fixing-bugs). As a last resource, open an [issue](https://github.com/eried/portapack-mayhem/issues/new/choose).
+9
View File
@@ -0,0 +1,9 @@
version: '3.9'
services:
portapack-mayhem-dev:
build:
context: .
dockerfile: dockerfile-nogit-alpine
volumes:
- ".:/havoc"
+9
View File
@@ -0,0 +1,9 @@
version: '3.9'
services:
portapack-mayhem-dev:
build:
context: .
dockerfile: dockerfile-alpine
volumes:
- "./bin:/havocbin"
+18 -15
View File
@@ -1,6 +1,6 @@
#Download base image.
#The ubuntu:latest tag points to the "latest LTS"
FROM ubuntu:latest
#The ubuntu:20.04 tag points to the "20.04 LTS"
FROM ubuntu:20.04
#Set location to download ARM toolkit from.
# This will need to be changed over time or replaced with a static link to the latest release.
@@ -14,17 +14,19 @@ COPY ./ /havocsrc
#Fetch dependencies from APT
RUN apt-get update && \
apt-get install -y tar wget dfu-util cmake python bzip2 curl && \
apt-get -qy autoremove
apt-get install -y tar wget dfu-util cmake python bzip2 lz4 curl python3 python3-yaml && \
apt-get -qy autoremove
#Install current pip from PyPa
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py
RUN curl https://bootstrap.pypa.io/pip/3.4/get-pip.py -o get-pip.py && \
python get-pip.py
#Fetch additional dependencies from Python 2.x pip
RUN pip install pyyaml
RUN ln -s /usr/bin/python3 /usr/bin/python && \
ln -s /usr/bin/pip3 /usr/bin/pip
RUN rm -rf /usr/bin/python && \
rm -rf /usr/bin/pip && \
ln -s /usr/bin/python3 /usr/bin/python && \
ln -s /usr/bin/pip3 /usr/bin/pip
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
@@ -32,14 +34,15 @@ ENV LC_ALL C.UTF-8
#Grab the GNU ARM toolchain from arm.com
#Then extract contents to /opt/build/armbin/
RUN mkdir /opt/build && cd /opt/build && \
wget -O gcc-arm-none-eabi $ARMBINURL && \
mkdir armbin && \
tar --strip=1 -xjvf gcc-arm-none-eabi -C armbin
wget -O gcc-arm-none-eabi $ARMBINURL && \
mkdir armbin && \
tar --strip=1 -xjvf gcc-arm-none-eabi -C armbin
#Set environment variable so compiler knows where the toolchain lives
ENV PATH=$PATH:/opt/build/armbin/bin
CMD cd /havocsrc && \
mkdir build && cd build && \
cmake .. && make firmware && \
cp /portapack-havoc/firmware/portapack-h1-havoc.bin /havocbin
mkdir build && cd build && \
cmake .. && make firmware && \
cp /portapack-havoc/firmware/portapack-h1-havoc.bin /havocbin
+29
View File
@@ -0,0 +1,29 @@
# Download base image.
FROM alpine:edge
# Download ARM toolkit.
RUN apk add --no-cache gcc-arm-none-eabi gcc
# Create volume /havocbin for compiled firmware binaries
VOLUME /havocbin
# Copy build context (repository root) to /havocsrc
COPY ./ /havocsrc
# Fetch dependencies from APK
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk update -U
RUN apk add --no-cache git tar wget cmake curl bzip2 lz4 make
RUN apk add --no-cache dfu-util ccache icu-data-full
RUN apk add --no-cache python3 py3-pip py3-yaml
RUN apk add --no-cache py3-pyyaml-env-tag
RUN apk add --no-cache g++ gcc clang clang-static clang-dev llvm-dev llvm-static
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
CMD cd /havocsrc && \
mkdir build && cd build && \
cmake .. && make firmware && \
cp /portapack-havoc/firmware/portapack-h1-havoc.bin /havocbin
+4 -4
View File
@@ -11,17 +11,17 @@ WORKDIR /havoc/firmware
# Fetch dependencies from APT
RUN apt-get update && \
apt-get install -y git tar wget dfu-util cmake python3 ccache bzip2 curl && \
apt-get install -y git tar wget dfu-util cmake python3 ccache bzip2 liblz4-tool curl && \
apt-get -qy autoremove
#Install current pip from PyPa
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
RUN curl https://bootstrap.pypa.io/pip/3.4/get-pip.py -o get-pip.py && \
python3 get-pip.py
#Fetch additional dependencies from Python 3.x pip
RUN pip install pyyaml
RUN ln -s /usr/bin/python3 /usr/bin/python && \
ln -s /usr/bin/pip3 /usr/bin/pip
ln -s /usr/bin/pip3 /usr/bin/pip
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
@@ -38,4 +38,4 @@ RUN mkdir ~/bin && cd ~/bin && \
for tool in gcc g++ cpp c++;do ln -s $(which ccache) arm-none-eabi-$tool;done
CMD cd .. && cd build && \
cmake .. && make firmware
cmake .. && make firmware
+27
View File
@@ -0,0 +1,27 @@
FROM alpine:edge
# Download ARM toolkit.
RUN apk add --no-cache gcc-arm-none-eabi gcc
# Create volume /havoc/bin for compiled firmware binaries
VOLUME /havoc
WORKDIR /havoc/firmware
# Fetch dependencies from APK
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk update -U
RUN apk add --no-cache git tar wget cmake curl bzip2 lz4 make
RUN apk add --no-cache dfu-util ccache icu-data-full
RUN apk add --no-cache python3 py3-pip py3-yaml
RUN apk add --no-cache py3-pyyaml-env-tag
RUN apk add --no-cache g++ gcc clang clang-static clang-dev llvm-dev llvm-static
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# Configure CCACHE
RUN mkdir ~/bin && cd ~/bin && \
for tool in gcc g++ cpp c++;do ln -s $(which ccache) arm-none-eabi-$tool;done
CMD cd .. && cd build && \
cmake .. && make firmware
+1
View File
@@ -28,6 +28,7 @@ set(CHIBIOS_PORTAPACK ${PROJECT_SOURCE_DIR}/chibios-portapack)
set(EXTRACT_CPLD_DATA ${PROJECT_SOURCE_DIR}/tools/extract_cpld_data.py)
set(MAKE_SPI_IMAGE ${PROJECT_SOURCE_DIR}/tools/make_spi_image.py)
set(MAKE_IMAGE_CHUNK ${PROJECT_SOURCE_DIR}/tools/make_image_chunk.py)
set(LZ4 lz4)
set(FIRMWARE_NAME portapack-h1_h2-mayhem)
set(FIRMWARE_FILENAME ${FIRMWARE_NAME}.bin)
+22 -2
View File
@@ -103,6 +103,7 @@ set(CSRC
${PLATFORMSRC}
${BOARDSRC}
${FATFSSRC}
firmware_info.c
)
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
@@ -124,7 +125,7 @@ set(CPPSRC
${COMMON}/cpld_max5.cpp
${COMMON}/cpld_update.cpp
${COMMON}/cpld_xilinx.cpp
${COMMON}/debug.cpp
debug.cpp
${COMMON}/ert_packet.cpp
${COMMON}/event.cpp
${COMMON}/gcc.cpp
@@ -140,6 +141,7 @@ set(CPPSRC
${COMMON}/png_writer.cpp
${COMMON}/pocsag.cpp
${COMMON}/pocsag_packet.cpp
${COMMON}/aprs_packet.cpp
${COMMON}/portapack_io.cpp
${COMMON}/portapack_persistent_memory.cpp
${COMMON}/portapack_shared_memory.cpp
@@ -153,11 +155,14 @@ set(CPPSRC
${COMMON}/ui_widget.cpp
${COMMON}/utility.cpp
${COMMON}/wm8731.cpp
${COMMON}/performance_counter.cpp
app_settings.cpp
audio.cpp
baseband_api.cpp
capture_thread.cpp
clock_manager.cpp
core_control.cpp
database.cpp
de_bruijn.cpp
#emu_cc1101.cpp
rfm69.cpp
@@ -171,6 +176,7 @@ set(CPPSRC
irq_rtc.cpp
log_file.cpp
portapack.cpp
qrcodegen.cpp
radio.cpp
receiver_model.cpp
recent_entries.cpp
@@ -189,6 +195,7 @@ set(CPPSRC
hw/debounce.cpp
hw/encoder.cpp
hw/max2837.cpp
hw/max2839.cpp
hw/max5864.cpp
hw/rffc507x.cpp
hw/rffc507x_spi.cpp
@@ -205,6 +212,7 @@ set(CPPSRC
ui/ui_channel.cpp
ui/ui_font_fixed_8x16.cpp
ui/ui_geomap.cpp
ui/ui_qrcode.cpp
ui/ui_menu.cpp
ui/ui_btngrid.cpp
ui/ui_receiver.cpp
@@ -218,14 +226,18 @@ set(CPPSRC
apps/ui_adsb_rx.cpp
apps/ui_adsb_tx.cpp
apps/ui_afsk_rx.cpp
apps/ui_aprs_rx.cpp
apps/ui_btle_rx.cpp
apps/ui_nrf_rx.cpp
apps/ui_aprs_tx.cpp
apps/ui_bht_tx.cpp
apps/ui_dfu_menu.cpp
apps/ui_coasterp.cpp
apps/ui_debug.cpp
apps/ui_encoders.cpp
apps/ui_fileman.cpp
apps/ui_flash_utility.cpp
apps/ui_sd_over_usb.cpp
apps/ui_freqman.cpp
apps/ui_jammer.cpp
apps/ui_keyfob.cpp
@@ -261,8 +273,13 @@ set(CPPSRC
apps/lge_app.cpp
apps/pocsag_app.cpp
apps/replay_app.cpp
apps/ui_playlist.cpp
apps/gps_sim_app.cpp
apps/soundboard_app.cpp
apps/ui_recon.cpp
apps/ui_recon_settings.cpp
apps/ui_level.cpp
apps/tpms_app.cpp
apps/tpms_app.cpp
protocols/aprs.cpp
protocols/ax25.cpp
@@ -304,7 +321,10 @@ set(TCSRC)
set(TCPPSRC)
# List ASM source files here
set(ASMSRC ${PORTASM})
set(ASMSRC
${PORTASM}
lz4.S
)
set(INCDIR ${CMAKE_CURRENT_BINARY_DIR} ${COMMON} ${PORTINC} ${KERNINC} ${TESTINC}
${HALINC} ${PLATFORMINC} ${BOARDINC}
+115
View File
@@ -0,0 +1,115 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek
* Copyright (C) 2022 Arjan Onwezen
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "app_settings.hpp"
#include "file.hpp"
#include "portapack.hpp"
#include "portapack_persistent_memory.hpp"
#include <cstring>
#include <algorithm>
namespace std {
int app_settings::load(std::string application, AppSettings* settings) {
if (portapack::persistent_memory::load_app_settings()) {
file_path = folder+"/"+application+".ini";
auto error = settings_file.open(file_path);
if (!error.is_valid()) {
auto error = settings_file.read(file_content, std::min((int)settings_file.size(), MAX_FILE_CONTENT_SIZE));
settings->baseband_bandwidth=std::app_settings::read_long_long(file_content, "baseband_bandwidth=");
settings->channel_bandwidth=std::app_settings::read_long_long(file_content, "channel_bandwidth=");
settings->lna=std::app_settings::read_long_long(file_content, "lna=");
settings->modulation=std::app_settings::read_long_long(file_content, "modulation=");
settings->rx_amp=std::app_settings::read_long_long(file_content, "rx_amp=");
settings->rx_frequency=std::app_settings::read_long_long(file_content, "rx_frequency=");
settings->sampling_rate=std::app_settings::read_long_long(file_content, "sampling_rate=");
settings->vga=std::app_settings::read_long_long(file_content, "vga=");
settings->tx_amp=std::app_settings::read_long_long(file_content, "tx_amp=");
settings->tx_frequency=std::app_settings::read_long_long(file_content, "tx_frequency=");
settings->tx_gain=std::app_settings::read_long_long(file_content, "tx_gain=");
settings->step=std::app_settings::read_long_long(file_content, "step=");
settings->modulation=std::app_settings::read_long_long(file_content, "modulation=");
settings->am_config_index=std::app_settings::read_long_long(file_content, "am_config_index=");
settings->nbfm_config_index=std::app_settings::read_long_long(file_content, "nbfm_config_index=");
settings->wfm_config_index=std::app_settings::read_long_long(file_content, "wfm_config_index=");
settings->squelch=std::app_settings::read_long_long(file_content, "squelch=");
rc = SETTINGS_OK;
}
else rc = SETTINGS_UNABLE_TO_LOAD;
}
else rc = SETTINGS_DISABLED;
return(rc);
}
int app_settings::save(std::string application, AppSettings* settings) {
if (portapack::persistent_memory::save_app_settings()) {
file_path = folder+"/"+application+".ini";
make_new_directory(folder);
auto error = settings_file.create(file_path);
if (!error.is_valid()) {
// Save common setting
settings_file.write_line("baseband_bandwidth="+to_string_dec_uint(portapack::receiver_model.baseband_bandwidth()));
settings_file.write_line("channel_bandwidth="+to_string_dec_uint(portapack::transmitter_model.channel_bandwidth()));
settings_file.write_line("lna="+to_string_dec_uint(portapack::receiver_model.lna()));
settings_file.write_line("rx_amp="+to_string_dec_uint(portapack::receiver_model.rf_amp()));
settings_file.write_line("sampling_rate="+to_string_dec_uint(portapack::receiver_model.sampling_rate()));
settings_file.write_line("tx_amp="+to_string_dec_uint(portapack::transmitter_model.rf_amp()));
settings_file.write_line("tx_gain="+to_string_dec_uint(portapack::transmitter_model.tx_gain()));
settings_file.write_line("vga="+to_string_dec_uint(portapack::receiver_model.vga()));
// Save other settings from struct
settings_file.write_line("rx_frequency="+to_string_dec_uint(settings->rx_frequency));
settings_file.write_line("tx_frequency="+to_string_dec_uint(settings->tx_frequency));
settings_file.write_line("step="+to_string_dec_uint(settings->step));
settings_file.write_line("modulation="+to_string_dec_uint(settings->modulation));
settings_file.write_line("am_config_index="+to_string_dec_uint(settings->am_config_index));
settings_file.write_line("nbfm_config_index="+to_string_dec_uint(settings->nbfm_config_index));
settings_file.write_line("wfm_config_index="+to_string_dec_uint(settings->wfm_config_index));
settings_file.write_line("squelch="+to_string_dec_uint(settings->squelch));
rc = SETTINGS_OK;
}
else rc = SETTINGS_UNABLE_TO_SAVE;
}
else rc = SETTINGS_DISABLED;
return(rc);
}
long long int app_settings::read_long_long(char* file_content, const char* setting_text) {
auto position = strstr(file_content, (char *)setting_text);
if (position) {
position += strlen((char *)setting_text);
setting_value = strtoll(position, nullptr, 10);
}
return(setting_value);
}
} /* namespace std */
+92
View File
@@ -0,0 +1,92 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek
* Copyright (C) 2022 Arjan Onwezen
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef __APP_SETTINGS_H__
#define __APP_SETTINGS_H__
#include <cstddef>
#include <cstdint>
#include <string>
#include "file.hpp"
#include "string_format.hpp"
namespace std {
class app_settings {
public:
#define SETTINGS_OK 0 // settings found
#define SETTINGS_UNABLE_TO_LOAD -1 // settings (file) not found
#define SETTINGS_UNABLE_TO_SAVE -2 // unable to save settings
#define SETTINGS_DISABLED -3 // load/save settings disabled in settings
struct AppSettings {
uint32_t baseband_bandwidth;
uint32_t channel_bandwidth;
uint8_t lna;
uint8_t modulation;
uint8_t rx_amp;
uint32_t rx_frequency;
uint32_t sampling_rate;
uint8_t tx_amp;
uint32_t tx_frequency;
uint8_t tx_gain;
uint8_t vga;
uint32_t step;
uint8_t am_config_index;
uint8_t nbfm_config_index;
uint8_t wfm_config_index;
uint8_t squelch;
};
int load(std::string application, AppSettings* settings);
int save(std::string application, AppSettings* settings);
private:
#define MAX_FILE_CONTENT_SIZE 1000
char file_content[MAX_FILE_CONTENT_SIZE] = {};
std::string file_path = "";
std::string folder = "SETTINGS";
int rc = SETTINGS_OK;
File settings_file { };
long long int setting_value {} ;
long long int read_long_long(char* file_content, const char* setting_text);
}; // class app_settings
} // namespace std
#endif/*__APP_SETTINGS_H__*/
+96 -24
View File
@@ -22,6 +22,7 @@
#include "ais_app.hpp"
#include "string_format.hpp"
#include "database.hpp"
#include "baseband_api.hpp"
@@ -59,7 +60,32 @@ static float latlon_float(const int32_t normalized) {
static std::string mmsi(
const ais::MMSI& mmsi
) {
return to_string_dec_uint(mmsi, 9);
return to_string_dec_uint(mmsi, 9, '0'); // MMSI is always is always 9 characters pre-padded with zeros
}
static std::string mid(
const ais::MMSI& mmsi
) {
std::database db;
std::string mid_code = "";
std::database::MidDBRecord mid_record = {};
int return_code = 0;
// Try getting the country name from mids.db using MID code for given MMSI
mid_code = to_string_dec_uint(mmsi, 9, ' ').substr(0, 3);
return_code = db.retrieve_mid_record(&mid_record, mid_code);
switch(return_code) {
case DATABASE_RECORD_FOUND: return mid_record.country;
case DATABASE_NOT_FOUND: return "No mids.db file";
default: return "";
}
}
static std::string text(const std::string &text) {
size_t end = text.find_last_not_of("@");
return (end == std::string::npos) ? "" : text.substr(0, end + 1);
}
static std::string navigational_status(const unsigned int value) {
@@ -144,7 +170,7 @@ void AISLogger::on_packet(const ais::Packet& packet) {
}
log_file.write_entry(packet.received_at(), entry);
}
}
void AISRecentEntry::update(const ais::Packet& packet) {
received_count++;
@@ -175,6 +201,15 @@ void AISRecentEntry::update(const ais::Packet& packet) {
destination = packet.text(302, 20);
break;
case 18:
last_position.timestamp = packet.received_at();
last_position.speed_over_ground = packet.read(46, 10);
last_position.latitude = packet.latitude(85);
last_position.longitude = packet.longitude(57);
last_position.course_over_ground = packet.read(112, 12);
last_position.true_heading = packet.read(124, 9);
break;
case 21:
name = packet.text(43, 20);
last_position.timestamp = packet.received_at();
@@ -182,6 +217,23 @@ void AISRecentEntry::update(const ais::Packet& packet) {
last_position.longitude = packet.longitude(164);
break;
case 24:
switch (packet.read(38, 2))
{
case 0:
name = packet.text(40, 20);
break;
case 1:
call_sign = packet.text(90, 7);
break;
default:
break;
}
break;
default:
break;
}
@@ -198,9 +250,9 @@ void RecentEntriesTable<AISRecentEntries>::draw(
) {
std::string line = ais::format::mmsi(entry.mmsi) + " ";
if( !entry.name.empty() ) {
line += entry.name;
line += ais::format::text(entry.name);
} else {
line += entry.call_sign;
line += ais::format::text(entry.call_sign);
}
line.resize(target_rect.width() / 8, ' ');
@@ -221,7 +273,7 @@ AISRecentEntryDetailView::AISRecentEntryDetailView(NavigationView& nav) {
button_see_map.on_select = [this, &nav](Button&) {
geomap_view = nav.push<GeoMapView>(
entry_.name,
ais::format::text(entry_.name),
0,
GeoPos::alt_unit::METERS,
ais::format::latlon_float(entry_.last_position.latitude.normalized()),
@@ -232,15 +284,25 @@ AISRecentEntryDetailView::AISRecentEntryDetailView(NavigationView& nav) {
});
send_updates = true;
};
}
AISRecentEntryDetailView::AISRecentEntryDetailView(const AISRecentEntryDetailView&Entry) : View()
{
(void)Entry;
}
AISRecentEntryDetailView & AISRecentEntryDetailView::operator=(const AISRecentEntryDetailView&Entry)
{
(void)Entry;
return *this;
}
void AISRecentEntryDetailView::update_position() {
if (send_updates)
geomap_view->update_position(ais::format::latlon_float(entry_.last_position.latitude.normalized()), ais::format::latlon_float(entry_.last_position.longitude.normalized()), (float)entry_.last_position.true_heading);
geomap_view->update_position(ais::format::latlon_float(entry_.last_position.latitude.normalized()), ais::format::latlon_float(entry_.last_position.longitude.normalized()), (float)entry_.last_position.true_heading, 0);
}
void AISRecentEntryDetailView::focus() {
@@ -271,9 +333,10 @@ void AISRecentEntryDetailView::paint(Painter& painter) {
auto field_rect = Rect { rect.left(), rect.top() + 16, rect.width(), 16 };
field_rect = draw_field(painter, field_rect, s, "MMSI", ais::format::mmsi(entry_.mmsi));
field_rect = draw_field(painter, field_rect, s, "Name", entry_.name);
field_rect = draw_field(painter, field_rect, s, "Call", entry_.call_sign);
field_rect = draw_field(painter, field_rect, s, "Dest", entry_.destination);
field_rect = draw_field(painter, field_rect, s, "Ctry", ais::format::mid(entry_.mmsi));
field_rect = draw_field(painter, field_rect, s, "Name", ais::format::text(entry_.name));
field_rect = draw_field(painter, field_rect, s, "Call", ais::format::text(entry_.call_sign));
field_rect = draw_field(painter, field_rect, s, "Dest", ais::format::text(entry_.destination));
field_rect = draw_field(painter, field_rect, s, "Last", to_string_datetime(entry_.last_position.timestamp));
field_rect = draw_field(painter, field_rect, s, "Pos ", ais::format::latlon(entry_.last_position.latitude, entry_.last_position.longitude));
field_rect = draw_field(painter, field_rect, s, "Stat", ais::format::navigational_status(entry_.navigational_status));
@@ -304,19 +367,23 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } {
&recent_entry_detail_view,
});
// load app settings
auto rc = settings.load("rx_ais", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
target_frequency_ = app_settings.rx_frequency;
}
else target_frequency_ = initial_target_frequency;
recent_entry_detail_view.hidden(true);
target_frequency_ = initial_target_frequency;
radio::enable({
tuning_frequency(),
sampling_rate,
baseband_bandwidth,
rf::Direction::Receive,
receiver_model.rf_amp(),
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga()),
});
receiver_model.set_tuning_frequency(tuning_frequency());
receiver_model.set_sampling_rate(sampling_rate);
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias.
options_channel.on_change = [this](size_t, OptionsField::value_t v) {
this->on_frequency_changed(v);
@@ -337,7 +404,12 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } {
}
AISAppView::~AISAppView() {
radio::disable();
// save app settings
app_settings.rx_frequency = target_frequency_;
settings.save("rx_ais", &app_settings);
receiver_model.disable(); // to switch off all, including DC bias.
baseband::shutdown();
}
+13 -4
View File
@@ -33,7 +33,7 @@
#include "event_m0.hpp"
#include "log_file.hpp"
#include "app_settings.hpp"
#include "ais_packet.hpp"
#include "lpc43xx_cpp.hpp"
@@ -127,15 +127,18 @@ public:
void focus() override;
void paint(Painter&) override;
AISRecentEntryDetailView(const AISRecentEntryDetailView&Entry);
AISRecentEntryDetailView &operator=(const AISRecentEntryDetailView&Entry);
private:
AISRecentEntry entry_ { };
Button button_done {
{ 125, 216, 96, 24 },
{ 125, 224, 96, 24 },
"Done"
};
Button button_see_map {
{ 19, 216, 96, 24 },
{ 19, 224, 96, 24 },
"See on map"
};
GeoMapView* geomap_view { nullptr };
@@ -163,12 +166,18 @@ public:
void focus() override;
std::string title() const override { return "AIS"; };
std::string title() const override { return "AIS RX"; };
private:
static constexpr uint32_t initial_target_frequency = 162025000;
static constexpr uint32_t sampling_rate = 2457600;
static constexpr uint32_t baseband_bandwidth = 1750000;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
NavigationView& nav_;
AISRecentEntries recent { };
+42 -15
View File
@@ -129,11 +129,26 @@ AnalogAudioView::AnalogAudioView(
&waterfall
});
field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step());
// Set on_change before initialising the field
field_frequency.on_change = [this](rf::Frequency f) {
this->on_tuning_frequency_changed(f);
};
// load app settings
auto rc = settings.load("rx_audio", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
receiver_model.set_rf_amp(app_settings.rx_amp);
// field_frequency.set_value(app_settings.rx_frequency);
receiver_model.set_configuration_without_init(static_cast<ReceiverModel::Mode>(app_settings.modulation), app_settings.step, app_settings.am_config_index, app_settings.nbfm_config_index, app_settings.wfm_config_index, app_settings.squelch);
}
field_frequency.set_value(receiver_model.tuning_frequency());
//Filename Datetime and Frequency
record_view.set_filename_date_frequency(true);
field_frequency.set_step(receiver_model.frequency_step());
field_frequency.on_edit = [this, &nav]() {
// TODO: Provide separate modal method/scheme?
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
@@ -157,6 +172,7 @@ AnalogAudioView::AnalogAudioView(
const auto modulation = receiver_model.modulation();
options_modulation.set_by_value(toUType(modulation));
options_modulation.on_change = [this](size_t, OptionsField::value_t v) {
this->on_modulation_changed(static_cast<ReceiverModel::Mode>(v));
};
@@ -180,33 +196,47 @@ AnalogAudioView::AnalogAudioView(
audio::output::start();
update_modulation(static_cast<ReceiverModel::Mode>(modulation));
on_modulation_changed(static_cast<ReceiverModel::Mode>(modulation));
on_modulation_changed(static_cast<ReceiverModel::Mode>(modulation));
}
size_t AnalogAudioView::get_spec_bw_index() {
return spec_bw_index;
return spec_bw_index;
}
void AnalogAudioView::set_spec_bw(size_t index, uint32_t bw) {
spec_bw_index = index;
spec_bw = bw;
spec_bw_index = index;
spec_bw = bw;
baseband::set_spectrum(bw, spec_trigger);
receiver_model.set_sampling_rate(bw);
receiver_model.set_baseband_bandwidth(bw/2);
baseband::set_spectrum(bw, spec_trigger);
receiver_model.set_sampling_rate(bw);
receiver_model.set_baseband_bandwidth(bw/2);
}
uint16_t AnalogAudioView::get_spec_trigger() {
return spec_trigger;
return spec_trigger;
}
void AnalogAudioView::set_spec_trigger(uint16_t trigger) {
spec_trigger = trigger;
spec_trigger = trigger;
baseband::set_spectrum(spec_bw, spec_trigger);
baseband::set_spectrum(spec_bw, spec_trigger);
}
AnalogAudioView::~AnalogAudioView() {
// save app settings
app_settings.rx_frequency = field_frequency.value();
app_settings.lna = receiver_model.lna();
app_settings.vga = receiver_model.vga();
app_settings.rx_amp = receiver_model.rf_amp();
app_settings.step = receiver_model.frequency_step();
app_settings.modulation = (uint8_t)receiver_model.modulation();
app_settings.am_config_index = receiver_model.am_configuration();
app_settings.nbfm_config_index = receiver_model.nbfm_configuration();
app_settings.wfm_config_index = receiver_model.wfm_configuration();
app_settings.squelch = receiver_model.squelch_level();
settings.save("rx_audio", &app_settings);
// TODO: Manipulating audio codec here, and in ui_receiver.cpp. Good to do
// both?
audio::output::stop();
@@ -394,9 +424,6 @@ void AnalogAudioView::update_modulation(const ReceiverModel::Mode modulation) {
}
}
/*void AnalogAudioView::squelched() {
if (exit_on_squelch) nav_.pop();
}*/
void AnalogAudioView::handle_coded_squelch(const uint32_t value) {
float diff, min_diff = value;
+18 -9
View File
@@ -28,11 +28,11 @@
#include "ui_receiver.hpp"
#include "ui_spectrum.hpp"
#include "ui_record_view.hpp"
#include "ui_font_fixed_8x16.hpp"
#include "app_settings.hpp"
#include "tone_key.hpp"
namespace ui {
constexpr Style style_options_group {
@@ -53,12 +53,13 @@ private:
OptionsField options_config {
{ 3 * 8, 0 * 16 },
4,
5,
{
{ "DSB ", 0 },
{ "USB ", 0 },
{ "LSB ", 0 },
{ "CW ", 0 },
{ "DSB 9k ", 0 },
{ "DSB 6k ", 0 },
{ "USB+3k ", 0 },
{ "LSB-3k ", 0 },
{ "CW ", 0 },
}
};
};
@@ -116,6 +117,7 @@ private:
{ " 2m ", 2000000 },
{ " 1m ", 1000000 },
{ "500k", 500000 },
{ "100k", 100000 },
}
};
@@ -143,7 +145,7 @@ public:
void focus() override;
std::string title() const override { return "Analog audio"; };
std::string title() const override { return "Audio RX"; };
size_t get_spec_bw_index();
void set_spec_bw(size_t index, uint32_t bw);
@@ -154,6 +156,10 @@ public:
private:
static constexpr ui::Dim header_height = 3 * 16;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
const Rect options_view_rect { 0 * 8, 1 * 16, 30 * 8, 1 * 16 };
const Rect nbfm_view_rect { 0 * 8, 1 * 16, 18 * 8, 1 * 16 };
@@ -216,7 +222,10 @@ private:
RecordView record_view {
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
u"AUD_????", RecordView::FileType::WAV, 4096, 4
u"AUD",
RecordView::FileType::WAV,
4096,
4
};
spectrum::WaterfallWidget waterfall { true };
+21 -5
View File
@@ -57,11 +57,23 @@ AnalogTvView::AnalogTvView(
&tv
});
field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step());
// Set on_change before initialising the field
field_frequency.on_change = [this](rf::Frequency f) {
this->on_tuning_frequency_changed(f);
};
// load app settings
auto rc = settings.load("rx_tv", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
receiver_model.set_rf_amp(app_settings.rx_amp);
field_frequency.set_value(app_settings.rx_frequency);
}
else field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step());
field_frequency.on_edit = [this, &nav]() {
// TODO: Provide separate modal method/scheme?
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
@@ -106,12 +118,15 @@ AnalogTvView::AnalogTvView(
}
AnalogTvView::~AnalogTvView() {
// save app settings
app_settings.rx_frequency = field_frequency.value();
settings.save("rx_tv", &app_settings);
// TODO: Manipulating audio codec here, and in ui_receiver.cpp. Good to do
// both?
audio::output::stop();
receiver_model.disable();
baseband::shutdown();
}
@@ -199,7 +214,7 @@ void AnalogTvView::on_show_options_rf_gain() {
void AnalogTvView::on_show_options_modulation() {
std::unique_ptr<Widget> widget;
const auto modulation = static_cast<ReceiverModel::Mode>(receiver_model.modulation());
static_cast<ReceiverModel::Mode>(receiver_model.modulation());
tv.show_audio_spectrum_view(true);
set_options_widget(std::move(widget));
@@ -216,6 +231,7 @@ void AnalogTvView::on_reference_ppm_correction_changed(int32_t v) {
}
void AnalogTvView::on_headphone_volume_changed(int32_t v) {
(void)v; //avoid warning
//tv::TVView::set_headphone_volume(this,v);
}
+7 -3
View File
@@ -29,7 +29,7 @@
#include "ui_receiver.hpp"
#include "ui_tv.hpp"
#include "ui_record_view.hpp"
#include "app_settings.hpp"
#include "ui_font_fixed_8x16.hpp"
#include "tone_key.hpp"
@@ -53,11 +53,15 @@ public:
void focus() override;
std::string title() const override { return "Analog TV"; };
std::string title() const override { return "AnalogTV RX"; };
private:
static constexpr ui::Dim header_height = 3 * 16;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
const Rect options_view_rect { 0 * 8, 1 * 16, 30 * 8, 1 * 16 };
const Rect nbfm_view_rect { 0 * 8, 1 * 16, 18 * 8, 1 * 16 };
@@ -107,7 +111,7 @@ private:
std::unique_ptr<Widget> options_widget { };
tv::TVWidget tv { true };
tv::TVWidget tv { };
void on_tuning_frequency_changed(rf::Frequency f);
void on_baseband_bandwidth_changed(uint32_t bandwidth_hz);
+44 -3
View File
@@ -74,17 +74,58 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
option_bandwidth.on_change = [this](size_t, uint32_t base_rate) {
sampling_rate = 8 * base_rate; // Decimation by 8 done on baseband side
/* base_rate is used for FFT calculation and display LCD, and also in recording writing SD Card rate. */
/* ex. sampling_rate values, 4Mhz, when recording 500 kHz (BW) and fs 8 Mhz , when selected 1 Mhz BW ...*/
/* ex. recording 500kHz BW to .C16 file, base_rate clock 500kHz x2(I,Q) x 2 bytes (int signed) =2MB/sec rate SD Card */
waterfall.on_hide();
record_view.set_sampling_rate(sampling_rate);
receiver_model.set_sampling_rate(sampling_rate);
/* Set up proper anti aliasing BPF bandwith in MAX2837 before ADC sampling according to the new added BW Options . */
switch(sampling_rate) { // we use the var fs (sampling_rate) , to set up BPF aprox < fs_max/2 by Nyquist theorem.
case 0 ... 2000000: // BW Captured range (0 <= 250kHz max ) fs = 8 x 250 kHz
anti_alias_baseband_bandwidth_filter = 1750000; // Minimum BPF MAX2837 for all those lower BW options.
break;
case 4000000 ... 6000000: // BW capture range (500k ... 750kHz max ) fs_max = 8 x 750kHz = 6Mhz
// BW 500k ... 750kHz , ex. 500kHz (fs = 8*BW = 4Mhz) , BW 600kHz (fs = 4,8Mhz) , BW 750 kHz (fs = 6Mhz)
anti_alias_baseband_bandwidth_filter = 2500000; // in some IC MAX2837 appear 2250000 , but both works similar.
break;
case 8800000: // BW capture 1,1Mhz fs = 8 x 1,1Mhz = 8,8Mhz . (1Mhz showed slightly higher noise background).
anti_alias_baseband_bandwidth_filter = 3500000;
break;
case 14000000: // BW capture 1,75Mhz , fs = 8 x 1,75Mhz = 14Mhz
// good BPF ,good matching, but LCD making flicker , refresh rate should be < 20 Hz , but reasonable picture
anti_alias_baseband_bandwidth_filter = 5000000;
break;
case 16000000: // BW capture 2Mhz , fs = 8 x 2Mhz = 16Mhz
// good BPF ,good matching, but LCD making flicker , refresh rate should be < 20 Hz , but reasonable picture
anti_alias_baseband_bandwidth_filter = 6000000;
break;
case 20000000: // BW capture 2,5Mhz , fs= 8 x 2,5 Mhz = 20Mhz
// good BPF ,good matching, but LCD making flicker , refresh rate should be < 20 Hz , but reasonable picture
anti_alias_baseband_bandwidth_filter = 7000000;
break;
default: // BW capture 2,75Mhz, fs = 8 x 2,75Mhz= 22Mhz max ADC sampling) and others.
// We tested also 9Mhz FPB stightly too much noise floor , better 8Mhz
anti_alias_baseband_bandwidth_filter = 8000000;
}
receiver_model.set_baseband_bandwidth(anti_alias_baseband_bandwidth_filter);
waterfall.on_show();
};
option_bandwidth.set_selected_index(7); // 500k
option_bandwidth.set_selected_index(7); // 500k, Preselected starting default option 500kHz
receiver_model.set_modulation(ReceiverModel::Mode::Capture);
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
receiver_model.enable();
record_view.on_error = [&nav](std::string message) {
+9 -2
View File
@@ -48,7 +48,7 @@ private:
static constexpr ui::Dim header_height = 3 * 16;
uint32_t sampling_rate = 0;
static constexpr uint32_t baseband_bandwidth = 2500000;
uint32_t anti_alias_baseband_bandwidth_filter = 2500000; // we rename the previous var , and change type static constexpr to normal var.
void on_tuning_frequency_changed(rf::Frequency f);
@@ -95,7 +95,14 @@ private:
{ " 50k ", 50000 },
{ "100k ", 100000 },
{ "250k ", 250000 },
{ "500k ", 500000 }
{ "500k ", 500000 }, // Previous Limit bandwith Option with perfect micro SD write .C16 format operaton.
{ "600k ", 600000 }, // That extended option is still possible to record with FW version Mayhem v1.41 (< 2,5MB/sec)
{ "750k ", 750000 }, // From that BW onwards, the LCD is ok, but the recorded file is auto decimated,(not real file size)
{ "1100k", 1100000 },
{ "1750k", 1750000 },
{ "2000k", 2000000 },
{ "2500k", 2500000 },
{ "2750k", 2750000 } // That is our max Capture option , to keep using later / 8 decimation (22Mhz sampling ADC)
}
};
+444
View File
@@ -0,0 +1,444 @@
// Part of dump1090, a Mode S message decoder for RTLSDR devices.
//
// dump1090.h: main program header
//
// Copyright (c) 2014-2016 Oliver Jowett <oliver@mutability.co.uk>
//
// This file is free software: you may copy, redistribute and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation, either version 2 of the License, or (at your
// option) any later version.
//
// This file is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// This file incorporates work covered by the following copyright and
// permission notice:
//
// Copyright (C) 2012 by Salvatore Sanfilippo <antirez@gmail.com>
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __DUMP1090_H
#define __DUMP1090_H
// Default version number, if not overriden by the Makefile
#ifndef MODES_DUMP1090_VERSION
# define MODES_DUMP1090_VERSION "unknown"
#endif
#ifndef MODES_DUMP1090_VARIANT
# define MODES_DUMP1090_VARIANT "dump1090-unknown"
#endif
#define MODES_DEFAULT_FREQ 1090000000
#define MODES_DEFAULT_WIDTH 1000
#define MODES_DEFAULT_HEIGHT 700
#define MODES_RTL_BUFFERS 15 // Number of RTL buffers
#define MODES_RTL_BUF_SIZE (16*16384) // 256k
#define MODES_MAG_BUF_SAMPLES (MODES_RTL_BUF_SIZE / 2) // Each sample is 2 bytes
#define MODES_MAG_BUFFERS 12 // Number of magnitude buffers (should be smaller than RTL_BUFFERS for flowcontrol to work)
#define MODES_AUTO_GAIN -100 // Use automatic gain
#define MODES_MAX_GAIN 999999 // Use max available gain
#define MODES_MSG_SQUELCH_DB 4.0 // Minimum SNR, in dB
#define MODES_MSG_ENCODER_ERRS 3 // Maximum number of encoding errors
#define MODEAC_MSG_SAMPLES (25 * 2) // include up to the SPI bit
#define MODEAC_MSG_BYTES 2
#define MODEAC_MSG_SQUELCH_LEVEL 0x07FF // Average signal strength limit
#define MODES_PREAMBLE_US 8 // microseconds = bits
#define MODES_PREAMBLE_SAMPLES (MODES_PREAMBLE_US * 2)
#define MODES_PREAMBLE_SIZE (MODES_PREAMBLE_SAMPLES * sizeof(uint16_t))
#define MODES_LONG_MSG_BYTES 14
#define MODES_SHORT_MSG_BYTES 7
#define MODES_LONG_MSG_BITS (MODES_LONG_MSG_BYTES * 8)
#define MODES_SHORT_MSG_BITS (MODES_SHORT_MSG_BYTES * 8)
#define MODES_LONG_MSG_SAMPLES (MODES_LONG_MSG_BITS * 2)
#define MODES_SHORT_MSG_SAMPLES (MODES_SHORT_MSG_BITS * 2)
#define MODES_LONG_MSG_SIZE (MODES_LONG_MSG_SAMPLES * sizeof(uint16_t))
#define MODES_SHORT_MSG_SIZE (MODES_SHORT_MSG_SAMPLES * sizeof(uint16_t))
#define MODES_OS_PREAMBLE_SAMPLES (20)
#define MODES_OS_PREAMBLE_SIZE (MODES_OS_PREAMBLE_SAMPLES * sizeof(uint16_t))
#define MODES_OS_LONG_MSG_SAMPLES (268)
#define MODES_OS_SHORT_MSG_SAMPLES (135)
#define MODES_OS_LONG_MSG_SIZE (MODES_LONG_MSG_SAMPLES * sizeof(uint16_t))
#define MODES_OS_SHORT_MSG_SIZE (MODES_SHORT_MSG_SAMPLES * sizeof(uint16_t))
#define MODES_OUT_BUF_SIZE (1500)
#define MODES_OUT_FLUSH_SIZE (MODES_OUT_BUF_SIZE - 256)
#define MODES_OUT_FLUSH_INTERVAL (60000)
#define MODES_USER_LATLON_VALID (1<<0)
#define INVALID_ALTITUDE (-9999)
/* Where did a bit of data arrive from? In order of increasing priority */
typedef enum {
SOURCE_INVALID, /* data is not valid */
SOURCE_MODE_AC, /* A/C message */
SOURCE_MLAT, /* derived from mlat */
SOURCE_MODE_S, /* data from a Mode S message, no full CRC */
SOURCE_MODE_S_CHECKED, /* data from a Mode S message with full CRC */
SOURCE_TISB, /* data from a TIS-B extended squitter message */
SOURCE_ADSR, /* data from a ADS-R extended squitter message */
SOURCE_ADSB, /* data from a ADS-B extended squitter message */
} datasource_t;
/* What sort of address is this and who sent it?
* (Earlier values are higher priority)
*/
typedef enum {
ADDR_ADSB_ICAO, /* Mode S or ADS-B, ICAO address, transponder sourced */
ADDR_ADSB_ICAO_NT, /* ADS-B, ICAO address, non-transponder */
ADDR_ADSR_ICAO, /* ADS-R, ICAO address */
ADDR_TISB_ICAO, /* TIS-B, ICAO address */
ADDR_ADSB_OTHER, /* ADS-B, other address format */
ADDR_ADSR_OTHER, /* ADS-R, other address format */
ADDR_TISB_TRACKFILE, /* TIS-B, Mode A code + track file number */
ADDR_TISB_OTHER, /* TIS-B, other address format */
ADDR_MODE_A, /* Mode A */
ADDR_UNKNOWN /* unknown address format */
} addrtype_t;
typedef enum {
UNIT_FEET,
UNIT_METERS
} altitude_unit_t;
typedef enum {
UNIT_NAUTICAL_MILES,
UNIT_STATUTE_MILES,
UNIT_KILOMETERS,
} interactive_distance_unit_t;
typedef enum {
ALTITUDE_BARO,
ALTITUDE_GEOM
} altitude_source_t;
typedef enum {
AG_INVALID,
AG_GROUND,
AG_AIRBORNE,
AG_UNCERTAIN
} airground_t;
typedef enum {
SIL_INVALID, SIL_UNKNOWN, SIL_PER_SAMPLE, SIL_PER_HOUR
} sil_type_t;
typedef enum {
CPR_SURFACE, CPR_AIRBORNE, CPR_COARSE
} cpr_type_t;
typedef enum {
HEADING_INVALID, // Not set
HEADING_GROUND_TRACK, // Direction of track over ground, degrees clockwise from true north
HEADING_TRUE, // Heading, degrees clockwise from true north
HEADING_MAGNETIC, // Heading, degrees clockwise from magnetic north
HEADING_MAGNETIC_OR_TRUE, // HEADING_MAGNETIC or HEADING_TRUE depending on the HRD bit in opstatus
HEADING_TRACK_OR_HEADING // GROUND_TRACK / MAGNETIC / TRUE depending on the TAH bit in opstatus
} heading_type_t;
typedef enum {
COMMB_UNKNOWN,
COMMB_AMBIGUOUS,
COMMB_EMPTY_RESPONSE,
COMMB_DATALINK_CAPS,
COMMB_GICB_CAPS,
COMMB_AIRCRAFT_IDENT,
COMMB_ACAS_RA,
COMMB_VERTICAL_INTENT,
COMMB_TRACK_TURN,
COMMB_HEADING_SPEED
} commb_format_t;
typedef enum {
NAV_MODE_AUTOPILOT = 1,
NAV_MODE_VNAV = 2,
NAV_MODE_ALT_HOLD = 4,
NAV_MODE_APPROACH = 8,
NAV_MODE_LNAV = 16,
NAV_MODE_TCAS = 32
} nav_modes_t;
// Matches encoding of the ES type 28/1 emergency/priority status subfield
typedef enum {
EMERGENCY_NONE = 0,
EMERGENCY_GENERAL = 1,
EMERGENCY_LIFEGUARD = 2,
EMERGENCY_MINFUEL = 3,
EMERGENCY_NORDO = 4,
EMERGENCY_UNLAWFUL = 5,
EMERGENCY_DOWNED = 6,
EMERGENCY_RESERVED = 7
} emergency_t;
typedef enum {
NAV_ALT_INVALID, NAV_ALT_UNKNOWN, NAV_ALT_AIRCRAFT, NAV_ALT_MCP, NAV_ALT_FMS
} nav_altitude_source_t;
#define MODES_NON_ICAO_ADDRESS (1<<24) // Set on addresses to indicate they are not ICAO addresses
#define MODES_INTERACTIVE_REFRESH_TIME 250 // Milliseconds
#define MODES_INTERACTIVE_DISPLAY_TTL 60000 // Delete from display after 60 seconds
#define MODES_NET_HEARTBEAT_INTERVAL 60000 // milliseconds
#define MODES_CLIENT_BUF_SIZE 1024
#define MODES_NET_SNDBUF_SIZE (1024*64)
#define MODES_NET_SNDBUF_MAX (7)
#define HISTORY_SIZE 120
#define HISTORY_INTERVAL 30000
#define MODES_NOTUSED(V) ((void) V)
#define MAX_AMPLITUDE 65535.0
#define MAX_POWER (MAX_AMPLITUDE * MAX_AMPLITUDE)
#define FAUP_DEFAULT_RATE_MULTIPLIER 1.0 // FA Upload rate multiplier
//======================== structure declarations =========================
typedef enum {
SDR_NONE, SDR_IFILE, SDR_RTLSDR, SDR_BLADERF, SDR_HACKRF, SDR_LIMESDR
} sdr_type_t;
// The struct we use to store information about a decoded message.
struct modesMessage {
// Generic fields
unsigned char msg[MODES_LONG_MSG_BYTES]; // Binary message.
unsigned char verbatim[MODES_LONG_MSG_BYTES]; // Binary message, as originally received before correction
int msgbits; // Number of bits in message
int msgtype; // Downlink format #
uint32_t crc; // Message CRC
int correctedbits; // No. of bits corrected
uint32_t addr; // Address Announced
addrtype_t addrtype; // address format / source
uint64_t timestampMsg; // Timestamp of the message (12MHz clock)
uint64_t sysTimestampMsg; // Timestamp of the message (system time)
int remote; // If set this message is from a remote station
double signalLevel; // RSSI, in the range [0..1], as a fraction of full-scale power
int score; // Scoring from scoreModesMessage, if used
int reliable; // is this a "reliable" message (uncorrected DF11/DF17/DF18)?
datasource_t source; // Characterizes the overall message source
// Raw data, just extracted directly from the message
// The names reflect the field names in Annex 4
unsigned IID; // extracted from CRC of DF11s
unsigned AA;
unsigned AC;
unsigned CA;
unsigned CC;
unsigned CF;
unsigned DR;
unsigned FS;
unsigned ID;
unsigned KE;
unsigned ND;
unsigned RI;
unsigned SL;
unsigned UM;
unsigned VS;
unsigned char MB[7];
unsigned char MD[10];
unsigned char ME[7];
unsigned char MV[7];
// Decoded data
unsigned altitude_baro_valid : 1;
unsigned altitude_geom_valid : 1;
unsigned track_valid : 1;
unsigned track_rate_valid : 1;
unsigned heading_valid : 1;
unsigned roll_valid : 1;
unsigned gs_valid : 1;
unsigned ias_valid : 1;
unsigned tas_valid : 1;
unsigned mach_valid : 1;
unsigned baro_rate_valid : 1;
unsigned geom_rate_valid : 1;
unsigned squawk_valid : 1;
unsigned callsign_valid : 1;
unsigned cpr_valid : 1;
unsigned cpr_odd : 1;
unsigned cpr_decoded : 1;
unsigned cpr_relative : 1;
unsigned category_valid : 1;
unsigned geom_delta_valid : 1;
unsigned from_mlat : 1;
unsigned from_tisb : 1;
unsigned spi_valid : 1;
unsigned spi : 1;
unsigned alert_valid : 1;
unsigned alert : 1;
unsigned emergency_valid : 1;
unsigned metype; // DF17/18 ME type
unsigned mesub; // DF17/18 ME subtype
commb_format_t commb_format; // Inferred format of a comm-b message
// valid if altitude_baro_valid:
int altitude_baro; // Altitude in either feet or meters
altitude_unit_t altitude_baro_unit; // the unit used for altitude
// valid if altitude_geom_valid:
int altitude_geom; // Altitude in either feet or meters
altitude_unit_t altitude_geom_unit; // the unit used for altitude
// following fields are valid if the corresponding _valid field is set:
int geom_delta; // Difference between geometric and baro alt
float heading; // ground track or heading, degrees (0-359). Reported directly or computed from from EW and NS velocity
heading_type_t heading_type;// how to interpret 'track_or_heading'
float track_rate; // Rate of change of track, degrees/second
float roll; // Roll, degrees, negative is left roll
struct {
// Groundspeed, kts, reported directly or computed from from EW and NS velocity
// For surface movement, this has different interpretations for v0 and v2; both
// fields are populated. The tracking layer will update "gs.selected".
float v0;
float v2;
float selected;
} gs;
unsigned ias; // Indicated airspeed, kts
unsigned tas; // True airspeed, kts
double mach; // Mach number
int baro_rate; // Rate of change of barometric altitude, feet/minute
int geom_rate; // Rate of change of geometric (GNSS / INS) altitude, feet/minute
unsigned squawk; // 13 bits identity (Squawk), encoded as 4 hex digits
char callsign[9]; // 8 chars flight number, NUL-terminated
unsigned category; // A0 - D7 encoded as a single hex byte
emergency_t emergency; // emergency/priority status
// valid if cpr_valid
cpr_type_t cpr_type; // The encoding type used (surface, airborne, coarse TIS-B)
unsigned cpr_lat; // Non decoded latitude.
unsigned cpr_lon; // Non decoded longitude.
unsigned cpr_nucp; // NUCp/NIC value implied by message type
airground_t airground; // air/ground state
// valid if cpr_decoded:
double decoded_lat;
double decoded_lon;
unsigned decoded_nic;
unsigned decoded_rc;
// various integrity/accuracy things
struct {
unsigned nic_a_valid : 1;
unsigned nic_b_valid : 1;
unsigned nic_c_valid : 1;
unsigned nic_baro_valid : 1;
unsigned nac_p_valid : 1;
unsigned nac_v_valid : 1;
unsigned gva_valid : 1;
unsigned sda_valid : 1;
unsigned nic_a : 1; // if nic_a_valid
unsigned nic_b : 1; // if nic_b_valid
unsigned nic_c : 1; // if nic_c_valid
unsigned nic_baro : 1; // if nic_baro_valid
unsigned nac_p : 4; // if nac_p_valid
unsigned nac_v : 3; // if nac_v_valid
unsigned sil : 2; // if sil_type != SIL_INVALID
sil_type_t sil_type;
unsigned gva : 2; // if gva_valid
unsigned sda : 2; // if sda_valid
} accuracy;
// Operational Status
struct {
unsigned valid : 1;
unsigned version : 3;
unsigned om_acas_ra : 1;
unsigned om_ident : 1;
unsigned om_atc : 1;
unsigned om_saf : 1;
unsigned cc_acas : 1;
unsigned cc_cdti : 1;
unsigned cc_1090_in : 1;
unsigned cc_arv : 1;
unsigned cc_ts : 1;
unsigned cc_tc : 2;
unsigned cc_uat_in : 1;
unsigned cc_poa : 1;
unsigned cc_b2_low : 1;
unsigned cc_lw_valid : 1;
heading_type_t tah;
heading_type_t hrd;
unsigned cc_lw;
unsigned cc_antenna_offset;
} opstatus;
// combined:
// Target State & Status (ADS-B V2 only)
// Comm-B BDS4,0 Vertical Intent
struct {
unsigned heading_valid : 1;
unsigned fms_altitude_valid : 1;
unsigned mcp_altitude_valid : 1;
unsigned qnh_valid : 1;
unsigned modes_valid : 1;
float heading; // heading, degrees (0-359) (could be magnetic or true heading; magnetic recommended)
heading_type_t heading_type;
unsigned fms_altitude; // FMS selected altitude
unsigned mcp_altitude; // MCP/FCU selected altitude
float qnh; // altimeter setting (QFE or QNH/QNE), millibars
nav_altitude_source_t altitude_source;
nav_modes_t modes;
} nav;
};
#endif // __DUMP1090_H
+23 -4
View File
@@ -41,6 +41,7 @@ std::string type(Packet::Type value) {
case Packet::Type::Unknown: return "???";
case Packet::Type::IDM: return "IDM";
case Packet::Type::SCM: return "SCM";
case Packet::Type::SCMPLUS: return "SCM+";
}
}
@@ -62,7 +63,8 @@ std::string commodity_type(CommodityType value) {
void ERTLogger::on_packet(const ert::Packet& packet) {
const auto formatted = packet.symbols_formatted();
log_file.write_entry(packet.received_at(), formatted.data + "/" + formatted.errors);
std::string entry = ert::format::type(packet.type()) + " " + formatted.data + "/" + formatted.errors;
log_file.write_entry(packet.received_at(), entry);
}
const ERTRecentEntry::Key ERTRecentEntry::invalid_key { };
@@ -105,7 +107,20 @@ ERTAppView::ERTAppView(NavigationView&) {
&recent_entries_view,
});
radio::enable({
// load app settings
auto rc = settings.load("rx_ert", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
}
receiver_model.set_tuning_frequency(initial_target_frequency);
receiver_model.set_sampling_rate(sampling_rate);
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias.
/* radio::enable({
initial_target_frequency,
sampling_rate,
baseband_bandwidth,
@@ -113,7 +128,7 @@ ERTAppView::ERTAppView(NavigationView&) {
receiver_model.rf_amp(),
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga()),
});
}); */
logger = std::make_unique<ERTLogger>();
if( logger ) {
@@ -122,7 +137,11 @@ ERTAppView::ERTAppView(NavigationView&) {
}
ERTAppView::~ERTAppView() {
radio::disable();
// save app settings
settings.save("rx_ert", &app_settings);
receiver_model.disable(); // to switch off all, including DC bias and change flag enabled_
baseband::shutdown();
}
+9 -2
View File
@@ -28,7 +28,7 @@
#include "ui_channel.hpp"
#include "event_m0.hpp"
#include "app_settings.hpp"
#include "log_file.hpp"
#include "ert_packet.hpp"
@@ -50,6 +50,8 @@ struct ERTKey {
{
}
ERTKey( const ERTKey& other ) = default;
ERTKey& operator=(const ERTKey& other) {
id = other.id;
commodity_type = other.commodity_type;
@@ -123,12 +125,17 @@ public:
void focus() override;
std::string title() const override { return "ERT"; };
std::string title() const override { return "ERT RX"; };
private:
ERTRecentEntries recent { };
std::unique_ptr<ERTLogger> logger { };
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
const RecentEntriesColumns columns { {
{ "ID", 10 },
{ "Tp", 2 },
+20 -4
View File
@@ -29,6 +29,7 @@
#include "baseband_api.hpp"
#include "portapack.hpp"
#include "cpld_update.hpp"
#include "portapack_persistent_memory.hpp"
using namespace portapack;
@@ -140,13 +141,24 @@ void GpsSimAppView::start() {
}
);
}
field_rfgain.on_change = [this](int32_t v) {
tx_gain = v;
};
field_rfgain.set_value(tx_gain);
receiver_model.set_tx_gain(tx_gain);
field_rfamp.on_change = [this](int32_t v) {
rf_amp = (bool)v;
};
field_rfamp.set_value(rf_amp ? 14 : 0);
radio::enable({
receiver_model.tuning_frequency(),
sample_rate ,
baseband_bandwidth,
rf::Direction::Transmit,
receiver_model.rf_amp(),
rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga())
});
@@ -181,6 +193,9 @@ GpsSimAppView::GpsSimAppView(
NavigationView& nav
) : nav_ (nav)
{
tx_gain = 35;field_rfgain.set_value(tx_gain); // Initial default value (-12 dB's max 47dBs ).
field_rfamp.set_value(rf_amp ? 14 : 0); // Initial default value True. (TX RF amp on , +14dB's)
baseband::run_image(portapack::spi_flash::image_tag_gps);
add_children({
@@ -191,8 +206,8 @@ GpsSimAppView::GpsSimAppView(
&text_duration,
&progressbar,
&field_frequency,
&field_lna,
&field_rf_amp,
&field_rfgain,
&field_rfamp, // let's not use common persistent rf_amp , local rfamp is enough
&check_loop,
&button_play,
&waterfall,
@@ -228,7 +243,8 @@ GpsSimAppView::GpsSimAppView(
GpsSimAppView::~GpsSimAppView() {
radio::disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void GpsSimAppView::on_hide() {
+16 -6
View File
@@ -44,7 +44,7 @@ public:
void set_parent_rect(const Rect new_parent_rect) override;
void focus() override;
std::string title() const override { return "GPS Simulator"; };
std::string title() const override { return "GPS Sim TX"; };
private:
NavigationView& nav_;
@@ -52,6 +52,8 @@ private:
static constexpr ui::Dim header_height = 3 * 16;
uint32_t sample_rate = 0;
int32_t tx_gain { 47 };
bool rf_amp { true }; // aux private var to store temporal, same as Replay App rf_amp user selection.
static constexpr uint32_t baseband_bandwidth = 3000000; //filter bandwidth
const size_t read_size { 16384 };
const size_t buffer_count { 3 };
@@ -76,7 +78,7 @@ private:
bool ready_signal { false };
Labels labels {
{ { 10 * 8, 2 * 16 }, "LNA: A:", Color::light_grey() }
{ { 10 * 8, 2 * 16 }, "GAIN A:", Color::light_grey() }
};
Button button_open {
@@ -104,11 +106,19 @@ private:
FrequencyField field_frequency {
{ 0 * 8, 2 * 16 },
};
LNAGainField field_lna {
{ 14 * 8, 2 * 16 }
NumberField field_rfgain {
{ 14 * 8, 2 * 16 },
2,
{ 0, 47 },
1,
' '
};
RFAmpField field_rf_amp {
{ 19 * 8, 2 * 16 }
NumberField field_rfamp { // previously we were using "RFAmpField field_rf_amp" but that is general Receiver amp setting.
{ 19 * 8, 2 * 16 },
2,
{ 0, 14 }, // this time we will display GUI , 0 or 14 dBs same as Mic and Replay App
14,
' '
};
Checkbox check_loop {
{ 21 * 8, 2 * 16 },
+56 -41
View File
@@ -27,6 +27,7 @@
#include "lge_app.hpp"
#include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "ui_textentry.hpp"
#include "string_format.hpp"
@@ -39,12 +40,17 @@ using namespace portapack;
namespace ui {
void LGEView::focus() {
options_trame.focus();
options_frame.focus();
}
LGEView::~LGEView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_lge", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown();// better this function at the end, not load_sram() that sometimes produces hang up.
}
void LGEView::generate_lge_frame(const uint8_t command, const uint16_t address_a, const uint16_t address_b, std::vector<uint8_t>& data) {
@@ -70,10 +76,10 @@ void LGEView::generate_frame_touche() {
std::vector<uint8_t> data { 0x46, 0x28, 0x01, 0x45, 0x27, 0x01, 0x44, 0x23 };
console.write("\n\x1B\x07Touche:\x1B\x10");
generate_lge_frame(0x96, (field_joueur.value() << 8) | field_salle.value(), 0x0001, data);
generate_lge_frame(0x96, (field_player.value() << 8) | field_room.value(), 0x0001, data);
}
void LGEView::generate_frame_pseudo() {
void LGEView::generate_frame_nickname() {
// 0040.48s:
// 30 02 1A 00 19 00 FF 00 02 19 42 52 45 42 49 53 20 00 00 00 00 00 00 00 00 00
// 04 01 B0 04 7F 1F 11 33 40 1F 22 01 07 00 00 01 07 00 00 63 05 00 00 99 A2
@@ -90,15 +96,15 @@ void LGEView::generate_frame_pseudo() {
};
uint32_t c;
//data_header[2] = field_salle.value(); // ?
//data_footer[0] = field_salle.value(); // ?
//data_header[2] = field_room.value(); // ?
//data_footer[0] = field_room.value(); // ?
data.insert(data.begin(), data_header.begin(), data_header.end());
data.push_back(field_joueur.value());
data.push_back(field_player.value());
c = 0;
for (auto &ch : pseudo) {
for (auto &ch : nickname) {
data.push_back(ch);
c++;
}
@@ -108,16 +114,16 @@ void LGEView::generate_frame_pseudo() {
while (++c < 16)
data.push_back(0x00);
data.push_back(field_equipe.value());
data.push_back(field_team.value());
data.insert(data.end(), data_footer.begin(), data_footer.end());
console.write("\n\x1B\x0ESet pseudo:\x1B\x10");
console.write("\n\x1B\x0ESet nickname:\x1B\x10");
generate_lge_frame(0x02, 0x001A, field_joueur.value(), data);
generate_lge_frame(0x02, 0x001A, field_player.value(), data);
}
void LGEView::generate_frame_equipe() {
void LGEView::generate_frame_team() {
// 0041.83s:
// 3D 03 FF FF FF FF 02 03 01 52 4F 55 47 45 00 00 00 00 00 00 00 00 00 00 00 00
// 02 56 45 52 54 45 00 00 00 00 00 00 00 00 00 00 00 01 03 42 4C 45 55 45 00 00
@@ -129,10 +135,10 @@ void LGEView::generate_frame_equipe() {
data.insert(data.begin(), data_header.begin(), data_header.end());
data.push_back(field_equipe.value());
data.push_back(field_team.value());
c = 0;
for (auto &ch : pseudo) {
for (auto &ch : nickname) {
data.push_back(ch);
c++;
}
@@ -140,14 +146,14 @@ void LGEView::generate_frame_equipe() {
while (c++ < 16)
data.push_back(0x00);
data.push_back(field_equipe.value() - 1); // Color ?
data.push_back(field_team.value() - 1); // Color ?
console.write("\n\x1B\x0ASet equipe:\x1B\x10");
console.write("\n\x1B\x0ASet team:\x1B\x10");
generate_lge_frame(0x03, data);
}
void LGEView::generate_frame_broadcast_pseudo() {
void LGEView::generate_frame_broadcast_nickname() {
// 0043.86s:
// 3D 04 FF FF FF FF 02 03 19 42 52 45 42 49 53 20 00 00 00 00 00 00 00 00 00 04
// 07 50 4F 4E 45 59 20 00 00 00 00 00 00 00 00 00 00 05 1B 41 42 42 59 20 00 00
@@ -159,10 +165,10 @@ void LGEView::generate_frame_broadcast_pseudo() {
data.insert(data.begin(), data_header.begin(), data_header.end());
data.push_back(field_joueur.value());
data.push_back(field_player.value());
c = 0;
for (auto &ch : pseudo) {
for (auto &ch : nickname) {
data.push_back(ch);
c++;
}
@@ -172,9 +178,9 @@ void LGEView::generate_frame_broadcast_pseudo() {
while (++c < 16)
data.push_back(0x00);
data.push_back(field_equipe.value());
data.push_back(field_team.value());
console.write("\n\x1B\x09" "Broadcast pseudo:\x1B\x10");
console.write("\n\x1B\x09" "Broadcast nickname:\x1B\x10");
generate_lge_frame(0x04, data);
}
@@ -184,14 +190,14 @@ void LGEView::generate_frame_start() {
// 0A 05 FF FF FF FF 02 EC FF FF FF A3 35
std::vector<uint8_t> data { 0x02, 0xEC, 0xFF, 0xFF, 0xFF };
//data[0] = field_salle.value(); // ?
//data[0] = field_room.value(); // ?
console.write("\n\x1B\x0DStart:\x1B\x10");
generate_lge_frame(0x05, data);
}
void LGEView::generate_frame_gameover() {
std::vector<uint8_t> data { (uint8_t)field_salle.value() };
std::vector<uint8_t> data { (uint8_t)field_room.value() };
console.write("\n\x1B\x0CGameover:\x1B\x10");
generate_lge_frame(0x0D, data);
@@ -203,7 +209,7 @@ void LGEView::generate_frame_collier() {
// Custom
// 0C 00 13 37 13 37 id flags channel playerid zapduty zaptime checksum CRC CRC
// channel: field_channel
// playerid: field_joueur
// playerid: field_player
// zapduty: field_power
// zaptime: field_duration
@@ -218,8 +224,8 @@ void LGEView::generate_frame_collier() {
std::vector<uint8_t> data {
id,
flags,
(uint8_t)field_salle.value(),
(uint8_t)field_joueur.value(),
(uint8_t)field_room.value(),
(uint8_t)field_player.value(),
(uint8_t)field_power.value(),
(uint8_t)(field_duration.value() * 10)
};
@@ -285,11 +291,11 @@ LGEView::LGEView(NavigationView& nav) {
add_children({
&labels,
&options_trame,
&field_salle,
&button_texte,
&field_equipe,
&field_joueur,
&options_frame,
&field_room,
&button_text,
&field_team,
&field_player,
&field_id,
&field_power,
&field_duration,
@@ -300,20 +306,29 @@ LGEView::LGEView(NavigationView& nav) {
&tx_view
});
field_salle.set_value(1);
field_equipe.set_value(1);
field_joueur.set_value(1);
// load app settings
auto rc = settings.load("tx_lge", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
field_room.set_value(1);
field_team.set_value(1);
field_player.set_value(1);
field_id.set_value(1);
field_power.set_value(1);
field_duration.set_value(2);
button_texte.on_select = [this, &nav](Button&) {
button_text.on_select = [this, &nav](Button&) {
text_prompt(
nav,
pseudo,
nickname,
15,
[this](std::string& buffer) {
button_texte.set_text(buffer);
button_text.set_text(buffer);
});
};
@@ -326,15 +341,15 @@ LGEView::LGEView(NavigationView& nav) {
tx_view.on_start = [this]() {
if (tx_mode == IDLE) {
auto i = options_trame.selected_index_value();
auto i = options_frame.selected_index_value();
if (i == 0)
generate_frame_touche();
else if (i == 1)
generate_frame_pseudo();
generate_frame_nickname();
else if (i == 2)
generate_frame_equipe();
generate_frame_team();
else if (i == 3)
generate_frame_broadcast_pseudo();
generate_frame_broadcast_nickname();
else if (i == 4)
generate_frame_start();
else if (i == 5)
+28 -23
View File
@@ -30,6 +30,7 @@
#include "message.hpp"
#include "transmitter_model.hpp"
#include "portapack.hpp"
#include "app_settings.hpp"
namespace ui {
@@ -40,7 +41,7 @@ public:
void focus() override;
std::string title() const override { return "LGE tool"; };
std::string title() const override { return "LGE tool TX"; };
private:
enum tx_modes {
@@ -48,15 +49,19 @@ private:
SINGLE,
ALL
};
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
tx_modes tx_mode = IDLE;
RFM69 rfm69 { 5, 0x2DD4, true, true };
RFM69 rfm69 { 5, 0x2DD4, true, true };
uint32_t frame_size { 0 };
uint32_t repeats { 0 };
uint32_t channel_index { 0 };
std::string pseudo { "ABCDEF" };
std::string nickname { "ABCDEF" };
rf::Frequency channels[3] = { 868067000, 868183000, 868295000 };
@@ -68,9 +73,9 @@ private:
}
void generate_lge_frame(const uint8_t command, const uint16_t address_a, const uint16_t address_b, std::vector<uint8_t>& data);
void generate_frame_touche();
void generate_frame_pseudo();
void generate_frame_equipe();
void generate_frame_broadcast_pseudo();
void generate_frame_nickname();
void generate_frame_team();
void generate_frame_broadcast_nickname();
void generate_frame_start();
void generate_frame_gameover();
void generate_frame_collier();
@@ -79,28 +84,28 @@ private:
Labels labels {
//{ { 7 * 8, 1 * 8 }, "NO FUN ALLOWED !", Color::red() },
{ { 1 * 8, 1 * 8 }, "Trame:", Color::light_grey() },
{ { 1 * 8, 3 * 8 }, "Salle:", Color::light_grey() },
{ { 14 * 8, 3 * 8 }, "Texte:", Color::light_grey() },
{ { 0 * 8, 5 * 8 }, "Equipe:", Color::light_grey() },
{ { 0 * 8, 7 * 8 }, "Joueur:", Color::light_grey() },
{ { 0 * 8, 10 * 8 }, "Collier:", Color::light_grey() },
{ { 1 * 8, 1 * 8 }, "Frame:", Color::light_grey() },
{ { 2 * 8, 3 * 8 }, "Room:", Color::light_grey() },
{ { 14 * 8, 3 * 8 }, "Text:", Color::light_grey() },
{ { 2 * 8, 5 * 8 }, "Team:", Color::light_grey() },
{ { 0 * 8, 7 * 8 }, "Player:", Color::light_grey() },
{ { 0 * 8, 10 * 8 }, "Vest:", Color::light_grey() },
{ { 4 * 8, 12 * 8 }, "ID:", Color::light_grey() },
{ { 3 * 8, 14 * 8 }, "Pow: /10", Color::light_grey() },
{ { 1 * 8, 16 * 8 }, "Duree: x100ms", Color::light_grey() }
{ { 2 * 8, 16 * 8 }, "Time: x100ms", Color::light_grey() }
};
OptionsField options_trame {
OptionsField options_frame {
{ 7 * 8, 1 * 8 },
13,
{
{ "Touche", 0 },
{ "Set pseudo", 1 },
{ "Set equipe", 2 },
{ "Brdcst pseudo", 3 },
{ "Key", 0 },
{ "Set nickname", 1 },
{ "Set team", 2 },
{ "Brdcst nick", 3 },
{ "Start", 4 },
{ "Game over", 5 },
{ "Set collier", 6 }
{ "Set vest", 6 }
}
};
@@ -111,7 +116,7 @@ private:
true
};
NumberField field_salle {
NumberField field_room {
{ 7 * 8, 3 * 8 },
1,
{ 1, 2 },
@@ -119,12 +124,12 @@ private:
'0'
};
Button button_texte {
Button button_text {
{ 14 * 8, 5 * 8, 16 * 8, 3 * 8 },
"ABCDEF"
};
NumberField field_equipe {
NumberField field_team {
{ 7 * 8, 5 * 8 },
1,
{ 1, 6 },
@@ -132,7 +137,7 @@ private:
'0'
};
NumberField field_joueur {
NumberField field_player {
{ 7 * 8, 7 * 8 },
2,
{ 1, 50 },
+51 -20
View File
@@ -30,10 +30,11 @@ using namespace pocsag;
#include "string_format.hpp"
#include "utility.hpp"
#include "audio.hpp"
void POCSAGLogger::log_raw_data(const pocsag::POCSAGPacket& packet, const uint32_t frequency) {
std::string entry = "Raw: F:" + to_string_dec_uint(frequency) + "Hz " +
pocsag::bitrate_str(packet.bitrate()) + " Codewords:";
to_string_dec_uint(packet.bitrate()) + " Codewords:";
// Raw hex dump of all the codewords
for (size_t c = 0; c < 16; c++)
@@ -64,27 +65,40 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
add_children({
&rssi,
&channel,
&audio,
&field_rf_amp,
&field_lna,
&field_vga,
&field_frequency,
&options_bitrate,
&options_phase,
&check_log,
&field_volume,
&check_ignore,
&sym_ignore,
&console
});
// Set on_change before initialising the field
field_frequency.on_change = [this](rf::Frequency f) {
update_freq(f);
};
// load app settings
auto rc = settings.load("rx_pocsag", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
field_frequency.set_value(app_settings.rx_frequency);
}
else field_frequency.set_value(receiver_model.tuning_frequency());
receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio);
receiver_model.set_sampling_rate(3072000);
receiver_model.set_baseband_bandwidth(1750000);
receiver_model.enable();
field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step());
field_frequency.on_change = [this](rf::Frequency f) {
update_freq(f);
};
field_frequency.on_edit = [this, &nav]() {
// TODO: Provide separate modal method/scheme?
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
@@ -99,14 +113,11 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
logging = v;
};
options_bitrate.on_change = [this](size_t, OptionsField::value_t v) {
on_config_changed(v, options_phase.selected_index_value());
};
options_bitrate.set_selected_index(1); // 1200bps
options_phase.on_change = [this](size_t, OptionsField::value_t v) {
on_config_changed(options_bitrate.selected_index_value(),v);
field_volume.set_value((receiver_model.headphone_volume() - audio::headphone::volume_range().max).decibel() + 99);
field_volume.on_change = [this](int32_t v) {
this->on_headphone_volume_changed(v);
};
check_ignore.set_value(ignore);
check_ignore.on_select = [this](Checkbox&, bool v) {
ignore = v;
@@ -121,9 +132,21 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
logger = std::make_unique<POCSAGLogger>();
if (logger)
logger->append("pocsag.txt");
audio::output::start();
audio::output::unmute();
baseband::set_pocsag();
}
POCSAGAppView::~POCSAGAppView() {
// save app settings
app_settings.rx_frequency = field_frequency.value();
settings.save("rx_pocsag", &app_settings);
audio::output::stop();
// Save ignored address
persistent_memory::set_pocsag_ignore_address(sym_ignore.value_dec_u32());
@@ -135,6 +158,12 @@ void POCSAGAppView::focus() {
field_frequency.focus();
}
void POCSAGAppView::on_headphone_volume_changed(int32_t v) {
const auto new_volume = volume_t::decibel(v - 99) + audio::headphone::volume_range().max;
receiver_model.set_headphone_volume(new_volume);
}
// Useless ?
void POCSAGAppView::set_parent_rect(const Rect new_parent_rect) {
View::set_parent_rect(new_parent_rect);
@@ -154,11 +183,17 @@ void POCSAGAppView::on_packet(const POCSAGPacketMessage * message) {
// " Ignored address " + to_string_dec_uint(pocsag_state.address));
return;
}
// Too many errors for reliable decode
if ((ignore) && (pocsag_state.errors >= 3)) {
return;
}
std::string console_info;
const uint32_t roundVal = 50;
const uint32_t bitrate = roundVal * ((message->packet.bitrate() + (roundVal/2))/roundVal);
console_info = "\n" + to_string_datetime(message->packet.timestamp(), HM);
console_info += " " + pocsag::bitrate_str(message->packet.bitrate());
console_info += " " + to_string_dec_uint(bitrate);
console_info += " ADDR:" + to_string_dec_uint(pocsag_state.address);
console_info += " F" + to_string_dec_uint(pocsag_state.function);
@@ -201,10 +236,6 @@ void POCSAGAppView::on_packet(const POCSAGPacketMessage * message) {
logger->log_raw_data(message->packet, target_frequency());
}
void POCSAGAppView::on_config_changed(const uint32_t new_bitrate, bool new_phase) {
baseband::set_pocsag(pocsag_bitrates[new_bitrate], new_phase);
}
void POCSAGAppView::set_target_frequency(const uint32_t new_value) {
target_frequency_ = new_value;
receiver_model.set_tuning_frequency(new_value);
+23 -26
View File
@@ -28,7 +28,7 @@
#include "ui_rssi.hpp"
#include "log_file.hpp"
#include "app_settings.hpp"
#include "pocsag.hpp"
#include "pocsag_packet.hpp"
@@ -60,8 +60,12 @@ public:
private:
static constexpr uint32_t initial_target_frequency = 466175000;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
bool logging { true };
bool ignore { false };
bool ignore { true };
uint32_t last_address = 0xFFFFFFFF;
pocsag::POCSAGState pocsag_state { };
@@ -80,48 +84,41 @@ private:
Channel channel {
{ 21 * 8, 5, 6 * 8, 4 },
};
Audio audio{
{ 21 * 8, 10, 6 * 8, 4 },
};
FrequencyField field_frequency {
{ 0 * 8, 0 * 8 },
};
OptionsField options_bitrate {
{ 12 * 8, 21 },
7,
{
{ "512bps ", 0 },
{ "1200bps", 1 },
{ "2400bps", 2 }
}
};
OptionsField options_phase {
{ 6 * 8, 21 },
1,
{
{ "P", 0 },
{ "N", 1 },
}
};
Checkbox check_log {
{ 22 * 8, 21 },
{ 24 * 8, 21 },
3,
"LOG",
true
};
NumberField field_volume{
{ 28 * 8, 0 * 16 },
2,
{ 0, 99 },
1,
' ',
};
Checkbox check_ignore {
{ 1 * 8, 40 },
15,
"Ignore address:",
{ 1 * 8, 21 },
12,
"Ignore addr:",
true
};
SymField sym_ignore {
{ 19 * 8, 40 },
{ 16 * 8, 21 },
7,
SymField::SYMFIELD_DEC
};
Console console {
{ 0, 4 * 16, 240, 240 }
{ 0, 3 * 16, 240, 256 }
};
std::unique_ptr<POCSAGLogger> logger { };
@@ -132,7 +129,7 @@ private:
void on_packet(const POCSAGPacketMessage * message);
void on_config_changed(const uint32_t new_bitrate, const bool phase);
void on_headphone_volume_changed(int32_t v);
uint32_t target_frequency() const;
void set_target_frequency(const uint32_t new_value);
+51 -9
View File
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek
* Copyleft (ↄ) 2022 NotPike
*
* This file is part of PortaPack.
*
@@ -25,7 +26,7 @@
#include "ui_fileman.hpp"
#include "io_file.hpp"
#include "cpld_update.hpp"
#include "baseband_api.hpp"
#include "portapack.hpp"
#include "portapack_persistent_memory.hpp"
@@ -121,6 +122,7 @@ void ReplayAppView::start() {
auto open_error = p->open(file_path);
if( open_error.is_valid() ) {
file_error();
return; // Fixes TX bug if there's a file error
} else {
reader = std::move(p);
}
@@ -139,17 +141,37 @@ void ReplayAppView::start() {
}
);
}
field_rfgain.on_change = [this](int32_t v) {
tx_gain = v;
};
field_rfgain.set_value(tx_gain);
receiver_model.set_tx_gain(tx_gain);
field_rfamp.on_change = [this](int32_t v) {
rf_amp = (bool)v;
};
field_rfamp.set_value(rf_amp ? 14 : 0);
//Enable Bias Tee if selected
radio::set_antenna_bias(portapack::get_antenna_bias());
radio::enable({
receiver_model.tuning_frequency(),
sample_rate * 8 ,
sample_rate * 8,
baseband_bandwidth,
rf::Direction::Transmit,
receiver_model.rf_amp(),
rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga())
});
}
});
if (portapack::persistent_memory::stealth_mode()){
DisplaySleepMessage message;
EventDispatcher::send_message(message);
}
}
void ReplayAppView::stop(const bool do_loop) {
if( is_active() )
@@ -158,6 +180,7 @@ void ReplayAppView::stop(const bool do_loop) {
if (do_loop && check_loop.value()) {
start();
} else {
radio::set_antenna_bias(false); //Turn off Bias Tee
radio::disable();
button_play.set_bitmap(&bitmap_play);
}
@@ -180,6 +203,20 @@ ReplayAppView::ReplayAppView(
NavigationView& nav
) : nav_ (nav)
{
tx_gain = 35;field_rfgain.set_value(tx_gain); // Initial default value (-12 dB's max ).
field_rfamp.set_value(rf_amp ? 14 : 0); // Initial default value True. (TX RF amp on , +14dB's)
field_rfamp.on_change = [this](int32_t v) { // allow initial value change just after opened file.
rf_amp = (bool)v;
};
field_rfamp.set_value(rf_amp ? 14 : 0);
field_rfgain.on_change = [this](int32_t v) { // allow initial value change just after opened file.
tx_gain = v;
};
field_rfgain.set_value(tx_gain);
baseband::run_image(portapack::spi_flash::image_tag_replay);
add_children({
@@ -190,8 +227,8 @@ ReplayAppView::ReplayAppView(
&text_duration,
&progressbar,
&field_frequency,
&field_lna,
&field_rf_amp,
&field_rfgain,
&field_rfamp, // let's not use common rf_amp
&check_loop,
&button_play,
&waterfall,
@@ -227,7 +264,12 @@ ReplayAppView::ReplayAppView(
ReplayAppView::~ReplayAppView() {
radio::disable();
baseband::shutdown();
display.fill_rectangle({ 0,0,240, 320 },Color::black()); //Solving sometimes visible bottom waterfall artifacts, clearing all LCD pixels.
chThdSleepMilliseconds(40); // (that happened sometimes if we interrupt the waterfall play at the beggining of the play around 25% and exit )
hackrf::cpld::load_sram_no_verify(); // to leave all RX reception ok, without "ghost interference signal problem" at the exit .
baseband::shutdown(); // better this function at the end, after load_sram(). If not , sometimes produced hang up (now not , it is ok).
}
void ReplayAppView::on_hide() {
+16 -5
View File
@@ -51,6 +51,8 @@ private:
static constexpr ui::Dim header_height = 3 * 16;
uint32_t sample_rate = 0;
int32_t tx_gain { 47 };
bool rf_amp { true }; // aux private var to store temporal, Replay App rf_amp user selection.
static constexpr uint32_t baseband_bandwidth = 2500000;
const size_t read_size { 16384 };
const size_t buffer_count { 3 };
@@ -75,7 +77,7 @@ private:
bool ready_signal { false };
Labels labels {
{ { 10 * 8, 2 * 16 }, "LNA: A:", Color::light_grey() }
{ { 10 * 8, 2 * 16 }, "GAIN A:", Color::light_grey() }
};
Button button_open {
@@ -103,11 +105,20 @@ private:
FrequencyField field_frequency {
{ 0 * 8, 2 * 16 },
};
LNAGainField field_lna {
{ 14 * 8, 2 * 16 }
NumberField field_rfgain {
{ 14 * 8, 2 * 16 },
2,
{ 0, 47 },
1,
' '
};
RFAmpField field_rf_amp {
{ 19 * 8, 2 * 16 }
NumberField field_rfamp { // previously I was using "RFAmpField field_rf_amp" but that is general Receiver amp setting.
{ 19 * 8, 2 * 16 },
2,
{ 0, 14 }, // this time we will display GUI , 0 or 14 dBs same as Mic App
14,
' '
};
Checkbox check_loop {
{ 21 * 8, 2 * 16 },
+24 -3
View File
@@ -25,6 +25,7 @@
#include "soundboard_app.hpp"
#include "string_format.hpp"
#include "tonesets.hpp"
#include "cpld_update.hpp"
using namespace tonekey;
using namespace portapack;
@@ -110,7 +111,12 @@ void SoundBoardView::start_tx(const uint32_t id) {
1536000 / 20, // Update vu-meter at 20Hz
transmitter_model.channel_bandwidth(),
0, // Gain is unused
TONES_F2D(tone_key_frequency(tone_key_index), 1536000)
8, // shift_bits_s16, default 8 bits, but also unused
TONES_F2D(tone_key_frequency(tone_key_index), 1536000),
0, //AM
0, //DSB
0, //USB
0 //LSB
);
baseband::set_sample_rate(sample_rate);
@@ -130,6 +136,7 @@ void SoundBoardView::start_tx(const uint32_t id) {
}*/
void SoundBoardView::on_tx_progress(const uint32_t progress) {
(void)progress ; // avoid warning
//progressbar.set_value(progress);
}
@@ -199,7 +206,7 @@ void SoundBoardView::refresh_list() {
file_list[n].string().substr(0, 30),
ui::Color::white(),
nullptr,
[this](){
[this](KeyEvent){
on_select_entry();
}
});
@@ -235,6 +242,15 @@ SoundBoardView::SoundBoardView(
&button_next_page,
&tx_view
});
// load app settings
auto rc = settings.load("tx_soundboard", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
refresh_list();
@@ -275,9 +291,14 @@ SoundBoardView::SoundBoardView(
}
SoundBoardView::~SoundBoardView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_soundboard", &app_settings);
stop();
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
}
+6 -1
View File
@@ -30,6 +30,7 @@
#include "lfsr_random.hpp"
#include "io_wave.hpp"
#include "tone_key.hpp"
#include "app_settings.hpp"
namespace ui {
@@ -45,10 +46,14 @@ public:
void focus() override;
std::string title() const override { return "Soundboard"; };
std::string title() const override { return "Soundbrd TX"; };
private:
NavigationView& nav_;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
enum tx_modes {
NORMAL = 0,
+58 -11
View File
@@ -34,6 +34,9 @@ namespace tpms {
namespace format {
static bool use_kpa = true;
static bool use_celsius = true;
std::string type(Reading::Type type) {
return to_string_dec_uint(toUType(type), 2);
}
@@ -43,11 +46,11 @@ std::string id(TransponderID id) {
}
std::string pressure(Pressure pressure) {
return to_string_dec_int(pressure.kilopascal(), 3);
return to_string_dec_int(use_kpa? pressure.kilopascal():pressure.psi(), 3);
}
std::string temperature(Temperature temperature) {
return to_string_dec_int(temperature.celsius(), 3);
return to_string_dec_int(use_celsius? temperature.celsius():temperature.fahrenheit(), 3);
}
std::string flags(Flags flags) {
@@ -105,15 +108,15 @@ void RecentEntriesTable<TPMSRecentEntries>::draw(
std::string line = tpms::format::type(entry.type) + " " + tpms::format::id(entry.id);
if( entry.last_pressure.is_valid() ) {
line += " " + tpms::format::pressure(entry.last_pressure.value());
line += " " + tpms::format::pressure(entry.last_pressure.value());
} else {
line += " " " ";
line += " " " ";
}
if( entry.last_temperature.is_valid() ) {
line += " " + tpms::format::temperature(entry.last_temperature.value());
line += " " + tpms::format::temperature(entry.last_temperature.value());
} else {
line += " " " ";
line += " " " ";
}
if( entry.received_count > 999 ) {
@@ -139,13 +142,30 @@ TPMSAppView::TPMSAppView(NavigationView&) {
&rssi,
&channel,
&options_band,
&options_pressure,
&options_temperature,
&field_rf_amp,
&field_lna,
&field_vga,
&recent_entries_view,
&recent_entries_view
});
radio::enable({
// load app settings
auto rc = settings.load("rx_tpms", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
options_band.set_by_value(app_settings.rx_frequency);
}
else options_band.set_by_value(receiver_model.tuning_frequency());
receiver_model.set_tuning_frequency(tuning_frequency());
receiver_model.set_sampling_rate(sampling_rate);
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias.
/* radio::enable({
tuning_frequency(),
sampling_rate,
baseband_bandwidth,
@@ -153,13 +173,27 @@ TPMSAppView::TPMSAppView(NavigationView&) {
receiver_model.rf_amp(),
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga()),
});
}); */
options_band.on_change = [this](size_t, OptionsField::value_t v) {
this->on_band_changed(v);
};
options_band.set_by_value(target_frequency());
options_pressure.on_change = [this](size_t, int32_t i) {
tpms::format::use_kpa = !i;
update_view();
};
options_pressure.set_selected_index(0, true);
options_temperature.on_change = [this](size_t, int32_t i) {
tpms::format::use_celsius = !i;
update_view();
};
options_temperature.set_selected_index(0, true);
logger = std::make_unique<TPMSLogger>();
if( logger ) {
logger->append(u"tpms.txt");
@@ -167,7 +201,13 @@ TPMSAppView::TPMSAppView(NavigationView&) {
}
TPMSAppView::~TPMSAppView() {
radio::disable();
// save app settings
app_settings.rx_frequency = target_frequency_;
settings.save("rx_tpms", &app_settings);
receiver_model.disable(); // to switch off all, including DC bias and change flag enabled_
baseband::shutdown();
}
@@ -176,9 +216,16 @@ void TPMSAppView::focus() {
options_band.focus();
}
void TPMSAppView::update_view() {
recent_entries_view.set_parent_rect(view_normal_rect);
}
void TPMSAppView::set_parent_rect(const Rect new_parent_rect) {
View::set_parent_rect(new_parent_rect);
recent_entries_view.set_parent_rect({ 0, header_height, new_parent_rect.width(), new_parent_rect.height() - header_height });
view_normal_rect = { 0, header_height, new_parent_rect.width(), new_parent_rect.height() - header_height };
update_view();
}
void TPMSAppView::on_packet(const tpms::Packet& packet) {
+31 -6
View File
@@ -27,7 +27,7 @@
#include "ui_receiver.hpp"
#include "ui_rssi.hpp"
#include "ui_channel.hpp"
#include "app_settings.hpp"
#include "event_m0.hpp"
#include "log_file.hpp"
@@ -102,14 +102,18 @@ public:
void paint(Painter&) override { };
void focus() override;
std::string title() const override { return "TPMS"; };
std::string title() const override { return "TPMS RX"; };
private:
static constexpr uint32_t initial_target_frequency = 315000000;
static constexpr uint32_t sampling_rate = 2457600;
static constexpr uint32_t baseband_bandwidth = 1750000;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
MessageHandlerRegistration message_handler_packet {
Message::ID::TPMSPacket,
[this](Message* const p) {
@@ -121,6 +125,8 @@ private:
static constexpr ui::Dim header_height = 1 * 16;
ui::Rect view_normal_rect { };
RSSI rssi {
{ 21 * 8, 0, 6 * 8, 4 },
};
@@ -134,7 +140,25 @@ private:
3,
{
{ "315", 315000000 },
{ "434", 433920000 },
{ "433", 433920000 },
}
};
OptionsField options_pressure {
{ 5 * 8, 0 * 16 },
3,
{
{ "kPa", 0 },
{ "PSI", 1 }
}
};
OptionsField options_temperature {
{ 9 * 8, 0 * 16 },
1,
{
{ "C", 0 },
{ "F", 1 }
}
};
@@ -156,8 +180,8 @@ private:
const RecentEntriesColumns columns { {
{ "Tp", 2 },
{ "ID", 8 },
{ "kPa", 3 },
{ "C", 3 },
{ "Pres", 4 },
{ "Temp", 4 },
{ "Cnt", 3 },
{ "Fl", 2 },
} };
@@ -167,6 +191,7 @@ private:
void on_packet(const tpms::Packet& packet);
void on_show_list();
void update_view();
void on_band_changed(const uint32_t new_band_frequency);
+14 -6
View File
@@ -6,7 +6,8 @@ namespace ui
{
add_children({&console, &button_ok});
button_ok.on_select = [&nav](Button &) {
button_ok.on_select = [&nav](Button &)
{
nav.pop();
};
@@ -28,16 +29,23 @@ namespace ui
console.writeln("\x1B\x06Mayhem:\x1B\x10");
console.writeln("eried,euquiq,gregoryfenton");
console.writeln("johnelder,jwetzell,nnemanjan00");
console.writeln("N0vaPixel,klockee,jamesshao8");
console.writeln("ITAxReal,rascafr,mcules");
console.writeln("dqs105,strijar");
console.writeln("N0vaPixel,klockee,GullCode");
console.writeln("jamesshao8,ITAxReal,rascafr");
console.writeln("mcules,dqs105,strijar");
console.writeln("zhang00963,RedFox-Fr,aldude999");
console.writeln("East2West,fossum,ArjanOnwezen");
console.writeln("vXxOinvizioNxX,teixeluis");
console.writeln("Brumi-2021,texasyojimbo");
console.writeln("heurist1,intoxsick,ckuethe");
console.writeln("notpike,jLynx,zigad");
console.writeln("MichalLeonBorsuk,jimilinuxguy");
console.writeln("");
break;
case 2:
// https://github.com/eried/portapack-mayhem/graphs/contributors?to=2020-04-12&from=2015-07-31&type=c
console.writeln("\x1B\x06Havoc:\x1B\x10");
console.writeln("furrtek,mrmookie,notpike");
console.writeln("furrtek,mrmookie,NotPike");
console.writeln("mjwaxios,ImDroided,Giorgiofox");
console.writeln("F4GEV,z4ziggy,xmycroftx");
console.writeln("troussos,silascutler");
@@ -74,4 +82,4 @@ namespace ui
button_ok.focus();
}
} /* namespace ui */
} /* namespace ui */
+338 -94
View File
@@ -20,6 +20,8 @@
* Boston, MA 02110-1301, USA.
*/
#include <strings.h>
#include "ui_adsb_rx.hpp"
#include "ui_alphanum.hpp"
@@ -44,10 +46,10 @@ void RecentEntriesTable<AircraftRecentEntries>::draw(
auto entry_age = entry.age;
// Color decay for flights not being updated anymore
if (entry_age < ADSB_DECAY_A) {
if (entry_age < ADSB_CURRENT) {
aged_color = 0x10;
target_color = Color::green();
} else if ((entry_age >= ADSB_DECAY_A) && (entry_age < ADSB_DECAY_B)) {
} else if (entry_age < ADSB_RECENT) {
aged_color = 0x07;
target_color = Color::light_grey();
} else {
@@ -57,10 +59,13 @@ void RecentEntriesTable<AircraftRecentEntries>::draw(
std::string entry_string = "\x1B";
entry_string += aged_color;
entry_string += to_string_hex(entry.ICAO_address, 6) + " " +
entry.callsign + " " +
(entry.hits <= 999 ? to_string_dec_uint(entry.hits, 4) : "999+") + " " +
entry.time_string;
entry_string +=
(entry.callsign[0]!=' ' ? entry.callsign + " " : entry.icaoStr + " ") +
to_string_dec_uint((unsigned int)(entry.pos.altitude/100),4) +
to_string_dec_uint((unsigned int)entry.velo.speed,4) +
to_string_dec_uint((unsigned int)(entry.amp>>9),4) + " " +
(entry.hits <= 999 ? to_string_dec_uint(entry.hits, 3) + " " : "1k+ ") +
to_string_dec_uint(entry.age, 4);
painter.draw_string(
target_rect.location(),
@@ -69,7 +74,7 @@ void RecentEntriesTable<AircraftRecentEntries>::draw(
);
if (entry.pos.valid)
painter.draw_bitmap(target_rect.location() + Point(15 * 8, 0), bitmap_target, target_color, style.background);
painter.draw_bitmap(target_rect.location() + Point(8 * 8, 0), bitmap_target, target_color, style.background);
}
void ADSBLogger::log_str(std::string& logline) {
@@ -78,6 +83,115 @@ void ADSBLogger::log_str(std::string& logline) {
log_file.write_entry(datetime,logline);
}
// Aircraft Details
void ADSBRxAircraftDetailsView::focus() {
button_close.focus();
}
ADSBRxAircraftDetailsView::~ADSBRxAircraftDetailsView() {
on_close_();
}
ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView(
NavigationView& nav,
const AircraftRecentEntry& entry,
const std::function<void(void)> on_close
) : entry_copy(entry),
on_close_(on_close)
{
add_children({
&labels,
&text_icao_address,
&text_registration,
&text_manufacturer,
&text_model,
&text_type,
&text_number_of_engines,
&text_engine_type,
&text_owner,
&text_operator,
&button_close
});
std::unique_ptr<ADSBLogger> logger { };
icao_code = to_string_hex(entry_copy.ICAO_address, 6);
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
// Try getting the aircraft information from icao24.db
return_code = db.retrieve_aircraft_record(&aircraft_record, icao_code);
switch(return_code) {
case DATABASE_RECORD_FOUND:
text_registration.set(aircraft_record.aircraft_registration);
text_manufacturer.set(aircraft_record.aircraft_manufacturer);
text_model.set(aircraft_record.aircraft_model);
text_owner.set(aircraft_record.aircraft_owner);
text_operator.set(aircraft_record.aircraft_operator);
// Check for ICAO type, e.g. L2J
if(strlen(aircraft_record.icao_type) == 3) {
switch(aircraft_record.icao_type[0]) {
case 'L':
text_type.set("Landplane");
break;
case 'S':
text_type.set("Seaplane");
break;
case 'A':
text_type.set("Amphibian");
break;
case 'H':
text_type.set("Helicopter");
break;
case 'G':
text_type.set("Gyrocopter");
break;
case 'T':
text_type.set("Tilt-wing aircraft");
break;
}
text_number_of_engines.set(std::string(1, aircraft_record.icao_type[1]));
switch(aircraft_record.icao_type[2]) {
case 'P':
text_engine_type.set("Piston engine");
break;
case 'T':
text_engine_type.set("Turboprop/Turboshaft engine");
break;
case 'J':
text_engine_type.set("Jet engine");
break;
case 'E':
text_engine_type.set("Electric engine");
break;
}
}
// Check for ICAO type designator
else if(strlen(aircraft_record.icao_type) == 4) {
if(strcmp(aircraft_record.icao_type,"SHIP") == 0) text_type.set("Airship");
else if(strcmp(aircraft_record.icao_type,"BALL") == 0) text_type.set("Balloon");
else if(strcmp(aircraft_record.icao_type,"GLID") == 0) text_type.set("Glider / sailplane");
else if(strcmp(aircraft_record.icao_type,"ULAC") == 0) text_type.set("Micro/ultralight aircraft");
else if(strcmp(aircraft_record.icao_type,"GYRO") == 0) text_type.set("Micro/ultralight autogyro");
else if(strcmp(aircraft_record.icao_type,"UHEL") == 0) text_type.set("Micro/ultralight helicopter");
else if(strcmp(aircraft_record.icao_type,"SHIP") == 0) text_type.set("Airship");
else if(strcmp(aircraft_record.icao_type,"PARA") == 0) text_type.set("Powered parachute/paraplane");
}
break;
case DATABASE_NOT_FOUND:
text_manufacturer.set("No icao24.db file");
break;
}
button_close.on_select = [&nav](Button&){
nav.pop();
};
};
// End of Aicraft details
void ADSBRxDetailsView::focus() {
button_see_map.focus();
}
@@ -101,7 +215,10 @@ void ADSBRxDetailsView::update(const AircraftRecentEntry& entry) {
text_frame_pos_odd.set(to_string_hex_array(entry_copy.frame_pos_odd.get_raw_data(), 14));
if (send_updates)
geomap_view->update_position(entry_copy.pos.latitude, entry_copy.pos.longitude, entry_copy.velo.heading);
{
geomap_view->update_tag(trimr(entry.callsign[0]!=' ' ? entry.callsign : to_string_hex(entry.ICAO_address, 6)));
geomap_view->update_position(entry_copy.pos.latitude, entry_copy.pos.longitude, entry_copy.velo.heading, entry_copy.pos.altitude);
}
}
ADSBRxDetailsView::~ADSBRxDetailsView() {
@@ -115,13 +232,10 @@ ADSBRxDetailsView::ADSBRxDetailsView(
) : entry_copy(entry),
on_close_(on_close)
{
char file_buffer[32] { 0 };
bool found = false;
std::string airline_code;
size_t c;
add_children({
&labels,
&text_icao_address,
&text_callsign,
&text_last_seen,
&text_airline,
@@ -130,6 +244,7 @@ ADSBRxDetailsView::ADSBRxDetailsView(
&text_info2,
&text_frame_pos_even,
&text_frame_pos_odd,
&button_aircraft_details,
&button_see_map
});
@@ -138,66 +253,106 @@ ADSBRxDetailsView::ADSBRxDetailsView(
// The following won't (shouldn't !) change for a given airborne aircraft
// Try getting the airline's name from airlines.db
auto result = db_file.open("ADSB/airlines.db");
if (!result.is_valid()) {
// Search for 3-letter code in 0x0000~0x2000
airline_code = entry_copy.callsign.substr(0, 3);
c = 0;
do {
db_file.read(file_buffer, 4);
if (!file_buffer[0])
break;
if (!airline_code.compare(0, 4, file_buffer))
found = true;
else
c++;
} while (!found);
if (found) {
db_file.seek(0x2000 + (c << 6));
db_file.read(file_buffer, 32);
text_airline.set(file_buffer);
db_file.read(file_buffer, 32);
text_country.set(file_buffer);
} else {
text_airline.set("Unknown");
text_country.set("Unknown");
}
} else {
text_airline.set("No airlines.db file");
text_country.set("No airlines.db file");
airline_code = entry_copy.callsign.substr(0, 3);
return_code = db.retrieve_airline_record(&airline_record, airline_code);
switch(return_code) {
case DATABASE_RECORD_FOUND:
text_airline.set(airline_record.airline);
text_country.set(airline_record.country);
break;
case DATABASE_NOT_FOUND:
text_airline.set("No airlines.db file");
break;
}
text_callsign.set(entry_copy.callsign);
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
button_aircraft_details.on_select = [this, &nav](Button&) {
aircraft_details_view = nav.push<ADSBRxAircraftDetailsView>(entry_copy, [this]() { send_updates = false;});
send_updates = false;
};
button_see_map.on_select = [this, &nav](Button&) {
geomap_view = nav.push<GeoMapView>(
entry_copy.callsign,
entry_copy.pos.altitude,
GeoPos::alt_unit::FEET,
entry_copy.pos.latitude,
entry_copy.pos.longitude,
entry_copy.velo.heading,
[this]() {
if (!send_updates) { // Prevent recursively launching the map
geomap_view = nav.push<GeoMapView>(
trimr(entry_copy.callsign[0]!=' ' ? entry_copy.callsign : entry_copy.icaoStr),
entry_copy.pos.altitude,
GeoPos::alt_unit::FEET,
entry_copy.pos.latitude,
entry_copy.pos.longitude,
entry_copy.velo.heading,
[this]() {
send_updates = false;
});
send_updates = true;
send_updates = true;
}
};
};
void ADSBRxView::focus() {
field_vga.focus();
}
ADSBRxView::~ADSBRxView() {
receiver_model.set_tuning_frequency(prevFreq); // Restore previous frequency on exit
// save app settings
settings.save("rx_adsb", &app_settings);
//TODO: once all apps keep there own settin previous frequency logic can be removed
receiver_model.set_tuning_frequency(prevFreq);
rtc_time::signal_tick_second -= signal_token_tick_second;
receiver_model.disable();
baseband::shutdown();
}
AircraftRecentEntry ADSBRxView::find_or_create_entry(uint32_t ICAO_address) {
auto it = find(recent, ICAO_address);
// If not found
if (it == std::end(recent)){
recent.emplace_front(ICAO_address); // Add it
it = find(recent, ICAO_address); // Find it again
}
return *it;
}
void ADSBRxView::replace_entry(AircraftRecentEntry & entry)
{
uint32_t ICAO_address = entry.ICAO_address;
std::replace_if( recent.begin(), recent.end(),
[ICAO_address](const AircraftRecentEntry & compEntry) {return ICAO_address == compEntry.ICAO_address;},
entry);
}
void ADSBRxView::remove_old_entries()
{
auto it = recent.rbegin();
auto end = recent.rend();
while (it != end)
{
if (it->age_state>=4) {
std::advance(it, 1);
recent.erase( it.base() );
} else {
break; // stop looking because the list is sorted
}
}
}
void ADSBRxView::sort_entries_by_state()
{
// Sorting List pn age_state using lambda function as comparator
recent.sort([](const AircraftRecentEntry & left, const AircraftRecentEntry & right){return (left.age_state < right.age_state); });
}
void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
logger = std::make_unique<ADSBLogger>();
rtc::RTC datetime;
std::string str_timestamp;
std::string callsign;
std::string str_info;
std::string logentry;
@@ -205,55 +360,77 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
auto frame = message->frame;
uint32_t ICAO_address = frame.get_ICAO_address();
if (frame.check_CRC() && frame.get_ICAO_address()) {
if (frame.check_CRC() && ICAO_address) {
rtcGetTime(&RTCD1, &datetime);
auto& entry = ::on_packet(recent, ICAO_address);
auto entry = find_or_create_entry(ICAO_address);
frame.set_rx_timestamp(datetime.minute() * 60 + datetime.second());
entry.reset_age();
str_timestamp = to_string_datetime(datetime, HMS);
entry.set_time_string(str_timestamp);
if (entry.hits==0)
{
entry.amp = message->amp; // Store amplitude on first hit
} else {
entry.amp = ((entry.amp*15)+message->amp)>>4; // Update smoothed amplitude on updates
}
entry.inc_hit();
logentry += to_string_hex_array(frame.get_raw_data(), 14) + " ";
logentry += "ICAO:" + to_string_hex(ICAO_address, 6) + " ";
if (logger) {
logentry += to_string_hex_array(frame.get_raw_data(), 14) + " ";
logentry += "ICAO:" + entry.icaoStr + " ";
}
if (frame.get_DF() == DF_ADSB) {
uint8_t msg_type = frame.get_msg_type();
uint8_t msg_sub = frame.get_msg_sub();
uint8_t * raw_data = frame.get_raw_data();
if ((msg_type >= 1) && (msg_type <= 4)) {
// 4: // surveillance, altitude reply
if ((msg_type >= AIRCRAFT_ID_L) && (msg_type <= AIRCRAFT_ID_H)) {
callsign = decode_frame_id(frame);
entry.set_callsign(callsign);
logentry+=callsign+" ";
} else if (((msg_type >= 9) && (msg_type <= 18)) || ((msg_type >= 20) && (msg_type <= 22))) {
if (logger) {
logentry+=callsign+" ";
}
}
// 9:
// 18: { // Extended squitter/non-transponder
// 21: // Comm-B, identity reply
// 20: // Comm-B, altitude reply
else if (((msg_type >= AIRBORNE_POS_BARO_L) && (msg_type <= AIRBORNE_POS_BARO_H)) ||
((msg_type >= AIRBORNE_POS_GPS_L) && (msg_type <= AIRBORNE_POS_GPS_H))) {
entry.set_frame_pos(frame, raw_data[6] & 4);
if (entry.pos.valid) {
str_info = "Alt:" + to_string_dec_int(entry.pos.altitude) +
" Lat:" + to_string_dec_int(entry.pos.latitude) +
"." + to_string_dec_int((int)abs(entry.pos.latitude * 1000) % 100, 2, '0') +
" Lon:" + to_string_dec_int(entry.pos.longitude) +
"." + to_string_dec_int((int)abs(entry.pos.longitude * 1000) % 100, 2, '0');
entry.set_info_string(str_info);
logentry+=str_info+ " ";
" Lat:" + to_string_decimal(entry.pos.latitude, 2) +
" Lon:" + to_string_decimal(entry.pos.longitude, 2);
entry.set_info_string(str_info);
if (logger) {
// printing the coordinates in the log file with more
// resolution, as we are not constrained by screen
// real estate there:
std::string log_info = "Alt:" + to_string_dec_int(entry.pos.altitude) +
" Lat:" + to_string_decimal(entry.pos.latitude, 7) +
" Lon:" + to_string_decimal(entry.pos.longitude, 7);
logentry+=log_info + " ";
}
if (send_updates)
details_view->update(entry);
}
} else if(msg_type == 19 && msg_sub >= 1 && msg_sub <= 4){
} else if(msg_type == AIRBORNE_VEL && msg_sub >= VEL_GND_SUBSONIC && msg_sub <= VEL_AIR_SUPERSONIC){
entry.set_frame_velo(frame);
logentry += "Type:" + to_string_dec_uint(msg_sub) +
" Hdg:" + to_string_dec_uint(entry.velo.heading) +
" Spd: "+ to_string_dec_int(entry.velo.speed);
if (send_updates)
details_view->update(entry);
if (logger) {
logentry += "Type:" + to_string_dec_uint(msg_sub) +
" Hdg:" + to_string_dec_uint(entry.velo.heading) +
" Spd: "+ to_string_dec_int(entry.velo.speed);
}
}
}
recent_entries_view.set_dirty();
logger = std::make_unique<ADSBLogger>();
replace_entry(entry);
} // frame.get_DF() == DF_ADSB
if (logger) {
logger->append(u"adsb.txt");
// will log each frame in format:
@@ -263,18 +440,70 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
}
}
void ADSBRxView::on_tick_second() {
// Decay and refresh if needed
for (auto& entry : recent) {
entry.inc_age();
if (details_view) {
if (send_updates && (entry.key() == detailed_entry_key))
details_view->update(entry);
} else {
if ((entry.age == ADSB_DECAY_A) || (entry.age == ADSB_DECAY_B))
recent_entries_view.set_dirty();
void ADSBRxView::on_tick_second() {
if (recent.size() <= 16){ // Not many entries update everything (16 is one screen full)
updateDetailsAndMap(1);
updateRecentEntries();
} else if (updateState==0) { // Even second
updateState = 1;
updateDetailsAndMap(2);
} else { // Odd second only performed when there are many entries
updateState = 0;
updateRecentEntries();
}
}
void ADSBRxView::updateDetailsAndMap(int ageStep) {
ui::GeoMarker marker;
bool storeNewMarkers = false;
// Sort and truncate the entries, grouped, newest group first
sort_entries_by_state();
truncate_entries(recent);
remove_old_entries();
// Calculate if it is time to update markers
if (send_updates && details_view && details_view->geomap_view) {
ticksSinceMarkerRefresh += ageStep;
if (ticksSinceMarkerRefresh >= MARKER_UPDATE_SECONDS) { // Update other aircraft every few seconds
storeNewMarkers = true;
ticksSinceMarkerRefresh=0;
}
} else {
ticksSinceMarkerRefresh = MARKER_UPDATE_SECONDS; // Send the markers as soon as the geoview exists
}
// Increment age, and pass updates to the details and map
const bool otherMarkersCanBeSent = send_updates && storeNewMarkers && details_view && details_view->geomap_view; // Save retesting all of this
MapMarkerStored markerStored = MARKER_NOT_STORED;
if (otherMarkersCanBeSent) {details_view->geomap_view->clear_markers();}
// Loop through all entries
for (auto& entry : recent) {
entry.inc_age(ageStep);
// Only if there is a details view
if (send_updates && details_view) {
if (entry.key() == detailed_entry_key) // Check if the ICAO address match
{
details_view->update(entry);
}
// Store if the view is present and the list isn't full
else if (otherMarkersCanBeSent && (markerStored != MARKER_LIST_FULL) && entry.pos.valid && (entry.age_state<=2))
{
marker.lon = entry.pos.longitude;
marker.lat = entry.pos.latitude;
marker.angle = entry.velo.heading;
marker.tag = trimr(entry.callsign[0]!=' ' ? entry.callsign : entry.icaoStr);
markerStored = details_view->geomap_view->store_marker(marker);
}
}
} // Loop through all entries, if only to update the age
}
void ADSBRxView::updateRecentEntries() {
// Redraw the list of aircraft
if (!send_updates){
recent_entries_view.set_dirty();
}
}
@@ -289,6 +518,21 @@ ADSBRxView::ADSBRxView(NavigationView& nav) {
&recent_entries_view
});
// load app settings
auto rc = settings.load("rx_adsb", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
}
else
{
field_lna.set_value(40);
field_vga.set_value(40);
}
recent_entries_view.set_parent_rect({ 0, 16, 240, 272 });
recent_entries_view.on_select = [this, &nav](const AircraftRecentEntry& entry) {
detailed_entry_key = entry.key();
@@ -304,11 +548,11 @@ ADSBRxView::ADSBRxView(NavigationView& nav) {
on_tick_second();
};
prevFreq = receiver_model.tuning_frequency(); // Store previous frequency on creation
baseband::set_adsb();
receiver_model.set_tuning_frequency(1090000000);
field_lna.set_value(40);
field_vga.set_value(40);
receiver_model.set_modulation(ReceiverModel::Mode::SpectrumAnalysis);
receiver_model.set_sampling_rate(2000000);
receiver_model.set_baseband_bandwidth(2500000);
+191 -25
View File
@@ -25,20 +25,48 @@
#include "ui_receiver.hpp"
#include "ui_geomap.hpp"
#include "ui_font_fixed_8x16.hpp"
#include "string_format.hpp"
#include "file.hpp"
#include "database.hpp"
#include "recent_entries.hpp"
#include "log_file.hpp"
#include "adsb.hpp"
#include "message.hpp"
#include "app_settings.hpp"
#include "crc.hpp"
using namespace adsb;
namespace ui {
#define ADSB_DECAY_A 10 // In seconds
#define ADSB_DECAY_B 30
#define ADSB_DECAY_C 60 // Can be used for removing old entries, RecentEntries already caps to 64
#define ADSB_CURRENT 10 // Seconds
#define ADSB_RECENT 30 // Seconds
#define ADSB_REMOVE 300 // Used for removing old entries
#define AIRCRAFT_ID_L 1 // aircraft ID message type (lowest type id)
#define AIRCRAFT_ID_H 4 // aircraft ID message type (highest type id)
#define SURFACE_POS_L 5 // surface position (lowest type id)
#define SURFACE_POS_H 8 // surface position (highest type id)
#define AIRBORNE_POS_BARO_L 9 // airborne position (lowest type id)
#define AIRBORNE_POS_BARO_H 18 // airborne position (highest type id)
#define AIRBORNE_VEL 19 // airborne velocities
#define AIRBORNE_POS_GPS_L 20 // airborne position (lowest type id)
#define AIRBORNE_POS_GPS_H 22 // airborne position (highest type id)
#define RESERVED_L 23 // reserved for other uses
#define RESERVED_H 31 // reserved for other uses
#define VEL_GND_SUBSONIC 1
#define VEL_GND_SUPERSONIC 2
#define VEL_AIR_SUBSONIC 3
#define VEL_AIR_SUPERSONIC 4
#define O_E_FRAME_TIMEOUT 20 // timeout between odd and even frames
struct AircraftRecentEntry {
using Key = uint32_t;
@@ -47,20 +75,24 @@ struct AircraftRecentEntry {
uint32_t ICAO_address { };
uint16_t hits { 0 };
uint16_t age_state { 1 };
uint32_t age { 0 };
uint32_t amp { 0 };
adsb_pos pos { false, 0, 0, 0 };
adsb_vel velo { false, 0, 999 };
adsb_vel velo { false, 0, 999, 0 };
ADSBFrame frame_pos_even { };
ADSBFrame frame_pos_odd { };
std::string icaoStr {" "};
std::string callsign { " " };
std::string time_string { "" };
std::string info_string { "" };
AircraftRecentEntry(
const uint32_t ICAO_address
) : ICAO_address { ICAO_address }
{
this->icaoStr = to_string_hex(ICAO_address, 6);
}
Key key() const {
@@ -82,7 +114,7 @@ struct AircraftRecentEntry {
frame_pos_odd = frame;
if (!frame_pos_even.empty() && !frame_pos_odd.empty()) {
if (abs(frame_pos_even.get_rx_timestamp() - frame_pos_odd.get_rx_timestamp()) < 20)
if (abs(frame_pos_even.get_rx_timestamp() - frame_pos_odd.get_rx_timestamp()) < O_E_FRAME_TIMEOUT)
pos = decode_frame_pos(frame_pos_even, frame_pos_odd);
}
}
@@ -95,16 +127,21 @@ struct AircraftRecentEntry {
info_string = new_info_string;
}
void set_time_string(std::string& new_time_string) {
time_string = new_time_string;
}
void reset_age() {
age = 0;
}
void inc_age() {
age++;
void inc_age(int delta) {
age+=delta;
if (age < ADSB_CURRENT){
age_state = pos.valid ? 0 : 1;
} else if(age < ADSB_RECENT){
age_state = 2;
} else if(age < ADSB_REMOVE){
age_state = 3;
} else{
age_state = 4;
}
}
};
@@ -122,6 +159,98 @@ private:
};
class ADSBRxAircraftDetailsView : public View {
public:
ADSBRxAircraftDetailsView(NavigationView&, const AircraftRecentEntry& entry, const std::function<void(void)> on_close);
~ADSBRxAircraftDetailsView();
ADSBRxAircraftDetailsView(const ADSBRxAircraftDetailsView&) = delete;
ADSBRxAircraftDetailsView(ADSBRxAircraftDetailsView&&) = delete;
ADSBRxAircraftDetailsView& operator=(const ADSBRxAircraftDetailsView&) = delete;
ADSBRxAircraftDetailsView& operator=(ADSBRxAircraftDetailsView&&) = delete;
void focus() override;
void update(const AircraftRecentEntry& entry);
std::string title() const override { return "AC Details"; };
AircraftRecentEntry get_current_entry() { return entry_copy; }
std::database::AircraftDBRecord aircraft_record = {};
private:
AircraftRecentEntry entry_copy { 0 };
std::function<void(void)> on_close_ { };
bool send_updates { false };
std::database db = { };
std::string icao_code = "";
int return_code = 0;
Labels labels {
{ { 0 * 8, 1 * 16 }, "ICAO:", Color::light_grey() },
{ { 0 * 8, 2 * 16 }, "Registration:", Color::light_grey() },
{ { 0 * 8, 3 * 16 }, "Manufacturer:", Color::light_grey() },
{ { 0 * 8, 5 * 16 }, "Model:", Color::light_grey() },
{ { 0 * 8, 7 * 16 }, "Type:", Color::light_grey() },
{ { 0 * 8, 8 * 16 }, "Number of engines:", Color::light_grey() },
{ { 0 * 8, 9 * 16 }, "Engine type:", Color::light_grey() },
{ { 0 * 8, 11 * 16 }, "Owner:", Color::light_grey() },
{ { 0 * 8, 13 * 16 }, "Operator:", Color::light_grey() }
};
Text text_icao_address {
{ 5 * 8, 1 * 16, 6 * 8, 16},
"-"
};
Text text_registration {
{ 13 * 8, 2 * 16, 8 * 8, 16 },
"-"
};
Text text_manufacturer {
{ 0 * 8, 4 * 16, 19 * 8, 16 },
"-"
};
Text text_model {
{ 0 * 8, 6 * 16, 30 * 8, 16 },
"-"
};
Text text_type {
{ 5 * 8, 7 * 16, 22 * 8, 16 },
"-"
};
Text text_number_of_engines {
{ 18 * 8, 8 * 16, 30 * 8, 16 },
"-"
};
Text text_engine_type {
{ 0 * 8, 10 * 16, 30 * 8, 16},
"-"
};
Text text_owner {
{ 0 * 8, 12 * 16, 30 * 8, 16 },
"-"
};
Text text_operator {
{ 0 * 8, 14 * 16, 30 * 8, 16 },
"-"
};
Button button_close {
{ 9 * 8, 16 * 16, 12 * 8, 3 * 16 },
"Back"
};
};
class ADSBRxDetailsView : public View {
public:
ADSBRxDetailsView(NavigationView&, const AircraftRecentEntry& entry, const std::function<void(void)> on_close);
@@ -137,16 +266,25 @@ public:
void update(const AircraftRecentEntry& entry);
std::string title() const override { return "Details"; };
AircraftRecentEntry get_current_entry() { return entry_copy; }
std::database::AirlinesDBRecord airline_record = {};
private:
AircraftRecentEntry entry_copy { 0 };
std::function<void(void)> on_close_ { };
GeoMapView* geomap_view { nullptr };
bool send_updates { false };
File db_file { };
private:
AircraftRecentEntry entry_copy { 0 };
std::function<void(void)> on_close_ { };
ADSBRxAircraftDetailsView* aircraft_details_view { nullptr };
bool send_updates { false };
std::database db = { };
std::string airline_code = "";
int return_code = 0;
Labels labels {
{ { 0 * 8, 1 * 16 }, "Callsign:", Color::light_grey() },
{ { 0 * 8, 1 * 16 }, "ICAO:", Color::light_grey() },
{ { 13 * 8, 1 * 16 }, "Callsign:", Color::light_grey() },
{ { 0 * 8, 2 * 16 }, "Last seen:", Color::light_grey() },
{ { 0 * 8, 3 * 16 }, "Airline:", Color::light_grey() },
{ { 0 * 8, 5 * 16 }, "Country:", Color::light_grey() },
@@ -154,8 +292,13 @@ private:
{ { 0 * 8, 15 * 16 }, "Odd position frame:", Color::light_grey() }
};
Text text_icao_address {
{ 5 * 8, 1 * 16, 6 * 8, 16},
"-"
};
Text text_callsign {
{ 9 * 8, 1 * 16, 8 * 8, 16 },
{ 22 * 8, 1 * 16, 8 * 8, 16 },
"-"
};
@@ -193,11 +336,17 @@ private:
"-"
};
Button button_aircraft_details {
{ 2 * 8, 9 * 16, 12 * 8, 3 * 16 },
"A/C details"
};
Button button_see_map {
{ 8 * 8, 9 * 16, 14 * 8, 3 * 16 },
{ 16 * 8, 9 * 16, 12 * 8, 3 * 16 },
"See on map"
};
};
class ADSBRxView : public View {
public:
@@ -211,18 +360,35 @@ public:
void focus() override;
std::string title() const override { return "ADS-B receive"; };
std::string title() const override { return "ADS-B RX"; };
void replace_entry(AircraftRecentEntry & entry);
void remove_old_entries();
AircraftRecentEntry find_or_create_entry(uint32_t ICAO_address);
void sort_entries_by_state();
private:
rf::Frequency prevFreq = { 0 };
std::unique_ptr<ADSBLogger> logger { };
void on_frame(const ADSBFrameMessage * message);
void on_tick_second();
int updateState = { 0 };
void updateRecentEntries();
void updateDetailsAndMap(int ageStep);
#define MARKER_UPDATE_SECONDS (5)
int ticksSinceMarkerRefresh { MARKER_UPDATE_SECONDS-1 };
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
const RecentEntriesColumns columns { {
{ "ICAO", 6 },
{ "Callsign", 9 },
{ "Hits", 4 },
{ "Time", 8 }
{ "ICAO/Call", 9 },
{ "Lvl", 3 },
{ "Spd", 3 },
{ "Amp", 3 },
{ "Hit", 3 },
{ "Age", 4 }
} };
AircraftRecentEntries recent { };
RecentEntriesView<RecentEntries<AircraftRecentEntry>> recent_entries_view { columns, recent };
+25 -7
View File
@@ -26,6 +26,7 @@
#include "manchester.hpp"
#include "string_format.hpp"
#include "portapack.hpp"
#include "cpld_update.hpp"
#include "baseband_api.hpp"
#include <cstring>
@@ -161,13 +162,16 @@ ADSBSpeedView::ADSBSpeedView(
add_children({
&labels_speed,
&labels_vert_rate,
&compass,
&field_angle,
&field_speed
&field_speed,
&field_vert_rate
});
field_angle.set_value(0);
field_speed.set_value(400);
field_vert_rate.set_value(0);
field_angle.on_change = [this](int32_t v) {
compass.set_value(v);
@@ -180,7 +184,7 @@ void ADSBSpeedView::collect_frames(const uint32_t ICAO_address, std::vector<ADSB
ADSBFrame temp_frame;
encode_frame_velo(temp_frame, ICAO_address, field_speed.value(),
field_angle.value(), 0); // TODO: v_rate
field_angle.value(), field_vert_rate.value()); // Added v_rate , ft/min , (+) climb , (-) descend .
frame_list.emplace_back(temp_frame);
}
@@ -203,7 +207,7 @@ void ADSBSquawkView::collect_frames(const uint32_t ICAO_address, std::vector<ADS
ADSBFrame temp_frame;
(void)ICAO_address;
encode_frame_squawk(temp_frame, field_squawk.value_dec_u32());
encode_frame_squawk(temp_frame, field_squawk.concatenate_4_octal_u16());
frame_list.emplace_back(temp_frame);
}
@@ -284,9 +288,15 @@ void ADSBTxView::focus() {
}
ADSBTxView::~ADSBTxView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_adsb", &app_settings);
transmitter_model.disable();
baseband::shutdown();
}
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, withouth ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void ADSBTxView::generate_frames() {
const uint32_t ICAO_address = sym_icao.value_hex_u64();
@@ -334,8 +344,16 @@ ADSBTxView::ADSBTxView(
&view_squawk,
&text_frame,
&tx_view
});
});
// load app settings
auto rc = settings.load("tx_adsb", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
tx_view.on_edit_frequency = [this, &nav]() {
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
new_view->on_changed = [this](rf::Frequency f) {
+14 -1
View File
@@ -28,6 +28,7 @@
#include "ui_transmitter.hpp"
#include "message.hpp"
#include "transmitter_model.hpp"
#include "app_settings.hpp"
#include "portapack.hpp"
using namespace adsb;
@@ -95,6 +96,10 @@ private:
{ { 1 * 8, 6 * 16 }, "Speed: kn Bearing: *", Color::light_grey() }
};
Labels labels_vert_rate {
{ { 1 * 8, 8 * 16 }, "Vert. rate: ft/min, (+/-)", Color::light_grey() }
};
Compass compass {
{ 21 * 8, 2 * 16 }
};
@@ -106,6 +111,10 @@ private:
NumberField field_speed {
{ 8 * 8, 6 * 16 }, 3, { 0, 999 }, 5, ' '
};
NumberField field_vert_rate {
{ 11 * 8, 8 * 16 }, 5, { -4096, 4096 }, 64, ' ' // Let's limit to +/-5k aprox , Ex. max safe descent vertical rate aprox -1000 ft/min on an instrument approach. , std step is 64
};
};
class ADSBSquawkView : public OptionTabView {
@@ -152,7 +161,7 @@ public:
void focus() override;
std::string title() const override { return "ADS-B transmit"; };
std::string title() const override { return "ADS-B TX"; };
private:
/*enum tx_modes {
@@ -189,6 +198,10 @@ private:
-1,
-1
};*/
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
//tx_modes tx_mode = IDLE;
NavigationView& nav_;
+14
View File
@@ -66,6 +66,15 @@ AFSKRxView::AFSKRxView(NavigationView& nav) {
&console
});
// load app settings
auto rc = settings.load("rx_afsk", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
}
// DEBUG
record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message);
@@ -164,6 +173,11 @@ void AFSKRxView::on_data(uint32_t value, bool is_data) {
}
AFSKRxView::~AFSKRxView() {
// save app settings
app_settings.rx_frequency = field_frequency.value();
settings.save("rx_afsk", &app_settings);
audio::output::stop();
receiver_model.disable();
baseband::shutdown();
+6 -2
View File
@@ -27,7 +27,7 @@
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "ui_record_view.hpp" // DEBUG
#include "app_settings.hpp"
#include "log_file.hpp"
#include "utility.hpp"
@@ -52,11 +52,15 @@ public:
void focus() override;
std::string title() const override { return "AFSK RX (beta)"; };
std::string title() const override { return "AFSK RX"; };
private:
void on_data(uint32_t value, bool is_data);
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
uint8_t console_color { 0 };
uint32_t prev_value { 0 };
std::string str_log { "" };
+422
View File
@@ -0,0 +1,422 @@
/*
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_aprs_rx.hpp"
#include "audio.hpp"
#include "rtc_time.hpp"
#include "baseband_api.hpp"
#include "string_format.hpp"
#include "portapack_persistent_memory.hpp"
using namespace portapack;
void APRSLogger::log_raw_data(const std::string& data) {
rtc::RTC datetime;
rtcGetTime(&RTCD1, &datetime);
log_file.write_entry(datetime, data);
}
namespace ui {
template<>
void RecentEntriesTable<APRSRecentEntries>::draw(
const Entry& entry,
const Rect& target_rect,
Painter& painter,
const Style& style
) {
char aged_color;
Color target_color;
// auto entry_age = entry.age;
target_color = Color::green();
aged_color = 0x10;
std::string entry_string = "\x1B";
entry_string += aged_color;
entry_string += entry.source_formatted;
entry_string.append(10 - entry.source_formatted.size(),' ');
entry_string += " ";
entry_string += (entry.hits <= 999 ? to_string_dec_uint(entry.hits, 4) : "999+");
entry_string += " ";
entry_string += entry.time_string;
painter.draw_string(
target_rect.location(),
style,
entry_string
);
if (entry.has_position){
painter.draw_bitmap(target_rect.location() + Point(12 * 8, 0), bitmap_target, target_color, style.background);
}
}
void APRSRxView::focus() {
options_region.focus();
}
void APRSRxView::update_freq(rf::Frequency f) {
receiver_model.set_tuning_frequency(f);
}
APRSRxView::APRSRxView(NavigationView& nav, Rect parent_rect) : View(parent_rect) {
baseband::run_image(portapack::spi_flash::image_tag_aprs_rx);
add_children({
&rssi,
&channel,
&field_rf_amp,
&field_lna,
&field_vga,
&options_region,
&field_frequency,
&record_view,
&console
});
// load app settings
auto rc = settings.load("rx_aprs", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
}
// DEBUG
record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message);
};
record_view.set_sampling_rate(24000);
options_region.on_change = [this](size_t, int32_t i) {
if (i == 0){
field_frequency.set_value(144390000);
} else if(i == 1){
field_frequency.set_value(144800000);
} else if(i == 2){
field_frequency.set_value(145175000);
} else if(i == 3){
field_frequency.set_value(144575000);
}
};
field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(100);
field_frequency.on_change = [this](rf::Frequency f) {
update_freq(f);
};
field_frequency.on_edit = [this, &nav]() {
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
new_view->on_changed = [this](rf::Frequency f) {
update_freq(f);
field_frequency.set_value(f);
};
};
options_region.set_selected_index(0, true);
logger = std::make_unique<APRSLogger>();
if (logger)
logger->append("APRS_RX_LOG.TXT");
baseband::set_aprs(1200);
audio::set_rate(audio::Rate::Hz_24000);
audio::output::start();
receiver_model.set_sampling_rate(3072000);
receiver_model.set_baseband_bandwidth(1750000);
receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio);
receiver_model.enable();
}
void APRSRxView::on_packet(const APRSPacketMessage* message){
std::string str_console = "\x1B";
aprs::APRSPacket packet = message->packet;
std::string stream_text = packet.get_stream_text();
str_console += (char)((console_color++ & 3) + 9);
str_console += stream_text;
if(logger){
logger->log_raw_data(stream_text);
}
//if(reset_console){ //having more than one console causes issues when switching tabs where one is disabled, and the other enabled breaking the scoll setup.
// console.on_hide();
// console.on_show();
// reset_console = false;
//}
console.writeln(str_console);
}
void APRSRxView::on_data(uint32_t value, bool is_data) {
std::string str_console = "\x1B";
std::string str_byte = "";
if (is_data) {
// Colorize differently after message splits
str_console += (char)((console_color & 3) + 9);
if (value == '\n') {
// Message split
console.writeln("");
console_color++;
if (logger) {
logger->log_raw_data(str_log);
str_log = "";
}
}
else {
if ((value >= 32) && (value < 127)) {
str_console += (char)value; // Printable
str_byte += (char)value;
} else {
str_console += "[" + to_string_hex(value, 2) + "]"; // Not printable
str_byte += "[" + to_string_hex(value, 2) + "]";
}
console.write(str_console);
if (logger) str_log += str_byte;
}
} else {
}
}
void APRSRxView::on_show(){
//some bug where the display scroll area is set to the entire screen when switching from the list tab with details showing back to the stream view.
//reset_console = true;
}
APRSRxView::~APRSRxView() {
// save app settings
settings.save("rx_aprs", &app_settings);
audio::output::stop();
receiver_model.disable();
baseband::shutdown();
}
void APRSTableView::on_show_list() {
details_view.hidden(true);
recent_entries_view.hidden(false);
send_updates = false;
focus();
}
void APRSTableView::on_show_detail(const APRSRecentEntry& entry) {
recent_entries_view.hidden(true);
details_view.hidden(false);
details_view.set_entry(entry);
details_view.update();
details_view.focus();
detailed_entry_key = entry.key();
send_updates = true;
}
APRSTableView::APRSTableView(NavigationView& nav, Rect parent_rec) : View(parent_rec), nav_ {nav} {
add_children({
&recent_entries_view,
&details_view
});
hidden(true);
details_view.hidden(true);
recent_entries_view.set_parent_rect({0, 0, 240, 280});
details_view.set_parent_rect({0, 0, 240, 280});
recent_entries_view.on_select = [this](const APRSRecentEntry& entry) {
this->on_show_detail(entry);
};
details_view.on_close = [this]() {
this->on_show_list();
};
/* for(size_t i = 0; i <32 ; i++){
std::string id = "test" + i;
auto& entry = ::on_packet(recent, i);
entry.set_source_formatted(id);
}
recent_entries_view.set_dirty(); */
/*
std::string str1 = "test1";
std::string str12 = "test2";
std::string str13 = "test2";
auto& entry = ::on_packet(recent, 0x1);
entry.set_source_formatted(str1);
auto& entry2 = ::on_packet(recent, 0x2);
entry2.set_source_formatted(str12);
auto& entry3 = ::on_packet(recent, 0x2);
entry2.set_source_formatted(str13);
recent_entries_view.set_dirty();
*/
}
void APRSTableView::on_pkt(const APRSPacketMessage* message){
aprs::APRSPacket packet = message->packet;
rtc::RTC datetime;
std::string str_timestamp;
std::string source_formatted = packet.get_source_formatted();
std::string info_string = packet.get_stream_text();
rtcGetTime(&RTCD1, &datetime);
auto& entry = ::on_packet(recent, packet.get_source());
entry.reset_age();
entry.inc_hit();
str_timestamp = to_string_datetime(datetime, HMS);
entry.set_time_string(str_timestamp);
entry.set_info_string(info_string);
entry.set_source_formatted(source_formatted);
if(entry.has_position && !packet.has_position()){
//maintain position info
}
else {
entry.set_has_position(packet.has_position());
entry.set_pos(packet.get_position());
}
if( entry.key() == details_view.entry().key() ) {
details_view.set_entry(entry);
details_view.update();
}
recent_entries_view.set_dirty();
}
void APRSTableView::on_show(){
on_show_list();
}
void APRSTableView::on_hide(){
details_view.hidden(true);
}
void APRSTableView::focus(){
recent_entries_view.focus();
}
APRSTableView::~APRSTableView(){
}
void APRSDetailsView::focus() {
button_done.focus();
}
void APRSDetailsView::set_entry(const APRSRecentEntry& entry){
entry_copy = entry;
}
void APRSDetailsView::update() {
if(!hidden()){
//uint32_t age = entry_copy.age;
console.clear(true);
console.write(entry_copy.info_string);
button_see_map.hidden(!entry_copy.has_position);
}
if (send_updates)
geomap_view->update_position(entry_copy.pos.latitude, entry_copy.pos.longitude, 0, 0);
}
APRSDetailsView::~APRSDetailsView() {
}
APRSDetailsView::APRSDetailsView(
NavigationView& nav
)
{
add_children({
&console,
&button_done,
&button_see_map
});
button_done.on_select = [this, &nav](Button&) {
console.clear(true);
this->on_close();
};
button_see_map.on_select = [this, &nav](Button&) {
geomap_view = nav.push<GeoMapView>(
entry_copy.source_formatted,
0, //entry_copy.pos.altitude,
GeoPos::alt_unit::FEET,
entry_copy.pos.latitude,
entry_copy.pos.longitude,
0, /*entry_copy.velo.heading,*/
[this]() {
send_updates = false;
hidden(false);
update();
});
send_updates = true;
hidden(true);
};
};
APRSRXView::APRSRXView(NavigationView& nav) : nav_ {nav} {
add_children({
&tab_view,
&view_stream,
&view_table
});
}
void APRSRXView::focus(){
tab_view.focus();
}
APRSRXView::~APRSRXView() {
}
} /* namespace ui */
+283
View File
@@ -0,0 +1,283 @@
/*
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef __UI_APRS_RX_H__
#define __UI_APRS_RX_H__
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "ui_record_view.hpp" // DEBUG
#include "ui_geomap.hpp"
#include "app_settings.hpp"
#include "recent_entries.hpp"
#include "ui_tabview.hpp"
#include "log_file.hpp"
#include "utility.hpp"
class APRSLogger {
public:
Optional<File::Error> append(const std::string& filename) {
return log_file.append(filename);
}
void log_raw_data(const std::string& data);
private:
LogFile log_file { };
};
namespace ui {
struct APRSRecentEntry {
using Key = uint64_t;
static constexpr Key invalid_key = 0xffffffffffffffff;
uint16_t hits { 0 };
uint32_t age { 0 };
uint64_t source { 0 };
std::string source_formatted { " " };
std::string time_string { "" };
std::string info_string { "" };
aprs::aprs_pos pos { 0 , 0 , 0 , 0 };
bool has_position = false;
APRSRecentEntry(uint64_t src)
{
source = src;
}
Key key() const {
return source;
}
void set_source_formatted(std::string& new_source) {
source_formatted = new_source;
}
void inc_hit() {
hits++;
}
void set_info_string(std::string& new_info_string) {
info_string = new_info_string;
}
void set_time_string(std::string& new_time_string) {
time_string = new_time_string;
}
void set_pos(aprs::aprs_pos pos_in){
pos = pos_in;
}
void set_has_position(bool has_pos){
has_position = has_pos;
}
void reset_age() {
age = 0;
}
void inc_age() {
age++;
}
};
class APRSDetailsView : public View {
public:
APRSDetailsView(NavigationView&);
~APRSDetailsView();
APRSDetailsView(const APRSDetailsView&) = delete;
APRSDetailsView(APRSDetailsView&&) = delete;
APRSDetailsView& operator=(const APRSDetailsView&) = delete;
APRSDetailsView& operator=(APRSDetailsView&&) = delete;
void focus() override;
void update();
void set_entry(const APRSRecentEntry& entry);
const APRSRecentEntry& entry() const { return entry_copy; };
std::string title() const override { return "Details"; };
std::function<void(void)> on_close { };
private:
APRSRecentEntry entry_copy { 0 };
GeoMapView* geomap_view { nullptr };
bool send_updates { false };
Console console {
{ 0, 0 * 16, 240, 224 }
};
Button button_done {
{ 160, 14 * 16, 8 * 8, 3 * 16 },
"Close"
};
Button button_see_map {
{ 80, 14 * 16, 8 * 8, 3 * 16 },
"Map"
};
};
using APRSRecentEntries = RecentEntries<APRSRecentEntry>;
class APRSTableView: public View {
public:
APRSTableView(NavigationView& nav, Rect parent_rec);
~APRSTableView();
void on_show() override;
void on_hide() override;
void focus() override;
void on_pkt(const APRSPacketMessage* message);
std::string title() const override { return "Stations"; };
private:
NavigationView& nav_;
const RecentEntriesColumns columns { {
{ "Source", 9 },
{ "Loc", 6 },
{ "Hits", 4 },
{ "Time", 8 }
} };
APRSRecentEntries recent { };
RecentEntriesView<RecentEntries<APRSRecentEntry>> recent_entries_view { columns, recent };
APRSDetailsView details_view { nav_ };
uint32_t detailed_entry_key { 0 };
bool send_updates { false };
void on_show_list();
void on_show_detail(const APRSRecentEntry& entry);
};
class APRSRxView : public View {
public:
APRSRxView(NavigationView& nav, Rect parent_rect);
~APRSRxView();
void on_show() override;
void focus() override;
std::string title() const override { return "APRS RX"; };
void on_packet(const APRSPacketMessage* message);
private:
void on_data(uint32_t value, bool is_data);
bool reset_console = false;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
uint8_t console_color { 0 };
std::string str_log { "" };
RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 }
};
LNAGainField field_lna {
{ 15 * 8, 0 * 16 }
};
VGAGainField field_vga {
{ 18 * 8, 0 * 16 }
};
RSSI rssi {
{ 21 * 8, 0, 6 * 8, 4 },
};
Channel channel {
{ 21 * 8, 5, 6 * 8, 4 },
};
OptionsField options_region {
{ 0 * 8, 0 * 8 },
3,
{
{ "NA ", 0 },
{ "EUR", 1 },
{ "AUS", 2 },
{ "NZ ", 3 }
}
};
FrequencyField field_frequency {
{ 3 * 8, 0 * 16 },
};
// DEBUG
RecordView record_view {
{ 0 * 8, 1 * 16, 30 * 8, 1 * 16 },
u"AFS_????", RecordView::FileType::WAV, 4096, 4
};
Console console {
{ 0, 2 * 16, 240, 240 }
};
void update_freq(rf::Frequency f);
std::unique_ptr<APRSLogger> logger { };
};
class APRSRXView : public View {
public:
APRSRXView(NavigationView& nav);
~APRSRXView();
void focus() override;
std::string title() const override { return "APRS RX"; };
private:
NavigationView& nav_;
Rect view_rect = { 0, 3 * 8, 240, 280 };
APRSRxView view_stream { nav_, view_rect };
APRSTableView view_table { nav_, view_rect };
TabView tab_view {
{ "Stream", Color::cyan(), &view_stream },
{ "List", Color::yellow(), &view_table }
};
MessageHandlerRegistration message_handler_packet {
Message::ID::APRSPacket,
[this](Message* const p) {
const auto message = static_cast<const APRSPacketMessage*>(p);
this->view_stream.on_packet(message);
this->view_table.on_pkt(message);
}
};
};
} /* namespace ui */
#endif/*__UI_APRS_RX_H__*/
+17 -2
View File
@@ -26,6 +26,7 @@
#include "aprs.hpp"
#include "string_format.hpp"
#include "portapack.hpp"
#include "cpld_update.hpp"
#include "baseband_api.hpp"
#include "portapack_shared_memory.hpp"
#include "portapack_persistent_memory.hpp"
@@ -43,8 +44,13 @@ void APRSTXView::focus() {
}
APRSTXView::~APRSTXView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_aprs", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void APRSTXView::start_tx() {
@@ -66,7 +72,7 @@ void APRSTXView::start_tx() {
1200,
2200,
1,
10000, //transmitter_model.channel_bandwidth(),
10000, //APRS uses fixed 10k bandwidth
8
);
}
@@ -95,6 +101,15 @@ APRSTXView::APRSTXView(NavigationView& nav) {
&tx_view
});
// load app settings
auto rc = settings.load("tx_aprs", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
button_set.on_select = [this, &nav](Button&) {
text_prompt(
nav,
+7 -9
View File
@@ -29,6 +29,7 @@
#include "message.hpp"
#include "transmitter_model.hpp"
#include "app_settings.hpp"
#include "portapack.hpp"
namespace ui {
@@ -40,17 +41,14 @@ public:
void focus() override;
std::string title() const override { return "APRS TX (beta)"; };
std::string title() const override { return "APRS TX"; };
private:
/*enum tx_modes {
IDLE = 0,
SINGLE,
SEQUENCE
};
tx_modes tx_mode = IDLE;*/
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
std::string payload { "" };
void start_tx();
@@ -103,7 +101,7 @@ private:
TransmitterView tx_view {
16 * 16,
5000,
10
0 // disable setting bandwith, since APRS used fixed 10k bandwidth
};
MessageHandlerRegistration message_handler_tx_progress {
+23 -7
View File
@@ -24,6 +24,7 @@
#include "string_format.hpp"
#include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "portapack_persistent_memory.hpp"
using namespace portapack;
@@ -96,9 +97,9 @@ void BHTView::on_tx_progress(const uint32_t progress, const bool done) {
if (target_system == XYLOS) {
if (done) {
if (tx_mode == SINGLE) {
if (checkbox_cligno.value()) {
if (checkbox_flashing.value()) {
// TODO: Thread !
chThdSleepMilliseconds(field_tempo.value() * 1000); // Dirty :(
chThdSleepMilliseconds(field_speed.value() * 1000); // Dirty :(
view_xylos.flip_relays();
start_tx();
} else
@@ -120,9 +121,9 @@ void BHTView::on_tx_progress(const uint32_t progress, const bool done) {
} else {
view_EPAR.half = false;
if (tx_mode == SINGLE) {
if (checkbox_cligno.value()) {
if (checkbox_flashing.value()) {
// TODO: Thread !
chThdSleepMilliseconds(field_tempo.value() * 1000); // Dirty :(
chThdSleepMilliseconds(field_speed.value() * 1000); // Dirty :(
view_EPAR.flip_relays();
start_tx();
} else
@@ -140,7 +141,13 @@ void BHTView::on_tx_progress(const uint32_t progress, const bool done) {
}
BHTView::~BHTView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_bht", &app_settings);
transmitter_model.disable();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
BHTView::BHTView(NavigationView& nav) {
@@ -150,13 +157,22 @@ BHTView::BHTView(NavigationView& nav) {
&view_xylos,
&view_EPAR,
&checkbox_scan,
&checkbox_cligno,
&field_tempo,
&checkbox_flashing,
&field_speed,
&progressbar,
&tx_view
});
field_tempo.set_value(1);
// load app settings
auto rc = settings.load("tx_bht", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
field_speed.set_value(1);
tx_view.on_edit_frequency = [this, &nav]() {
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
+22 -17
View File
@@ -32,6 +32,7 @@
#include "message.hpp"
#include "transmitter_model.hpp"
#include "encoders.hpp"
#include "app_settings.hpp"
#include "portapack.hpp"
namespace ui {
@@ -50,11 +51,11 @@ public:
private:
Labels labels {
{ { 8 * 8, 1 * 8 }, "Header:", Color::light_grey() },
{ { 4 * 8, 3 * 8 }, "Code ville:", Color::light_grey() },
{ { 7 * 8, 5 * 8 }, "Famille:", Color::light_grey() },
{ { 2 * 8, 7 * 8 + 2 }, "Sous-famille:", Color::light_grey() },
{ { 2 * 8, 11 * 8 }, "ID recepteur:", Color::light_grey() },
{ { 2 * 8, 14 * 8 }, "Relais:", Color::light_grey() }
{ { 4 * 8, 3 * 8 }, "City code:", Color::light_grey() },
{ { 7 * 8, 5 * 8 }, "Family:", Color::light_grey() },
{ { 2 * 8, 7 * 8 + 2 }, "Subfamily:", Color::light_grey() },
{ { 2 * 8, 11 * 8 }, "Receiver ID:", Color::light_grey() },
{ { 2 * 8, 14 * 8 }, "Relay:", Color::light_grey() }
};
NumberField field_header_a {
@@ -98,8 +99,8 @@ private:
Checkbox checkbox_wcsubfamily {
{ 20 * 8, 6 * 8 + 6 },
6,
"Toutes"
3,
"All"
};
NumberField field_receiver {
@@ -111,8 +112,8 @@ private:
};
Checkbox checkbox_wcid {
{ 20 * 8, 10 * 8 + 4 },
4,
"Tous"
3,
"All"
};
std::array<ImageOptionsField, 4> relay_states { };
@@ -139,9 +140,9 @@ public:
private:
Labels labels {
{ { 4 * 8, 1 * 8 }, "Code ville:", Color::light_grey() },
{ { 8 * 8, 3 * 8 }, "Groupe:", Color::light_grey() },
{ { 8 * 8, 7 * 8 }, "Relais:", Color::light_grey() }
{ { 4 * 8, 1 * 8 }, "City code:", Color::light_grey() },
{ { 8 * 8, 3 * 8 }, "Group:", Color::light_grey() },
{ { 8 * 8, 7 * 8 }, "Relay:", Color::light_grey() }
};
NumberField field_city {
@@ -178,9 +179,13 @@ public:
void focus() override;
std::string title() const override { return "BHT transmit"; };
std::string title() const override { return "BHT TX"; };
private:
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
void on_tx_progress(const uint32_t progress, const bool done);
void start_tx();
void stop_tx();
@@ -220,12 +225,12 @@ private:
"Scan"
};
Checkbox checkbox_cligno {
Checkbox checkbox_flashing {
{ 16 * 8, 25 * 8 },
6,
"Cligno"
8,
"Flashing"
};
NumberField field_tempo {
NumberField field_speed {
{ 26 * 8, 25 * 8 + 4 },
2,
{ 1, 99 },
+14
View File
@@ -60,6 +60,15 @@ BTLERxView::BTLERxView(NavigationView& nav) {
&console
});
// load app settings
auto rc = settings.load("rx_btle", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
}
// DEBUG
record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message);
@@ -152,6 +161,11 @@ void BTLERxView::on_data(uint32_t value, bool is_data) {
}
BTLERxView::~BTLERxView() {
// save app settings
app_settings.rx_frequency = field_frequency.value();
settings.save("rx_btle", &app_settings);
audio::output::stop();
receiver_model.disable();
baseband::shutdown();
+6
View File
@@ -27,6 +27,7 @@
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "app_settings.hpp"
#include "ui_record_view.hpp" // DEBUG
#include "utility.hpp"
@@ -45,6 +46,11 @@ public:
private:
void on_data(uint32_t value, bool is_data);
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
uint8_t console_color { 0 };
uint32_t prev_value { 0 };
std::string str_log { "" };
+16 -1
View File
@@ -23,6 +23,7 @@
#include "ui_coasterp.hpp"
#include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "portapack_persistent_memory.hpp"
#include <cstring>
@@ -37,8 +38,13 @@ void CoasterPagerView::focus() {
}
CoasterPagerView::~CoasterPagerView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_coaster", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void CoasterPagerView::generate_frame() {
@@ -119,6 +125,15 @@ CoasterPagerView::CoasterPagerView(NavigationView& nav) {
&tx_view
});
// load app settings
auto rc = settings.load("tx_coaster", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
// Bytes to nibbles
for (c = 0; c < 16; c++)
sym_data.set_sym(c, (data_init[c >> 1] >> ((c & 1) ? 0 : 4)) & 0x0F);
+6 -1
View File
@@ -28,6 +28,7 @@
#include "message.hpp"
#include "transmitter_model.hpp"
#include "app_settings.hpp"
#include "portapack.hpp"
namespace ui {
@@ -39,7 +40,7 @@ public:
void focus() override;
std::string title() const override { return "Si44xx TX"; };
std::string title() const override { return "BurgerPgrTX"; };
private:
enum tx_modes {
@@ -50,6 +51,10 @@ private:
tx_modes tx_mode = IDLE;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
void start_tx();
void generate_frame();
void on_tx_progress(const uint32_t progress, const bool done);
+69 -24
View File
@@ -31,6 +31,7 @@
#include "ui_sd_card_debug.hpp"
#include "portapack.hpp"
#include "portapack_persistent_memory.hpp"
using namespace portapack;
#include "irq_controls.hpp"
@@ -121,7 +122,8 @@ void TemperatureWidget::paint(Painter& painter) {
}
TemperatureWidget::temperature_t TemperatureWidget::temperature(const sample_t sensor_value) const {
return -35 + sensor_value * 4; //max2837 datasheet temp 25ºC has sensor value: 15
/*It seems to be a temperature difference of 25C*/
return -40 +(sensor_value * 4.31)+25; //max2837 datasheet temp 25ºC has sensor value: 15
}
std::string TemperatureWidget::temperature_str(const temperature_t temperature) const {
@@ -264,7 +266,9 @@ bool ControlsSwitchesWidget::on_key(const KeyEvent key) {
}
void ControlsSwitchesWidget::paint(Painter& painter) {
const std::array<Rect, 7> button_rects { {
const auto pos = screen_pos();
const std::array<Rect, 8> button_rects { {
{ 64, 32, 16, 16 }, // Right
{ 0, 32, 16, 16 }, // Left
{ 32, 64, 16, 16 }, // Down
@@ -272,27 +276,63 @@ void ControlsSwitchesWidget::paint(Painter& painter) {
{ 32, 32, 16, 16 }, // Select
{ 16, 96, 16, 16 }, // Encoder phase 0
{ 48, 96, 16, 16 }, // Encoder phase 1
{ 96, 0, 16, 16 }, // Dfu
} };
const auto pos = screen_pos();
auto switches_raw = control::debug::switches();
auto switches_debounced = get_switches_state().to_ulong();
auto switches_event = key_event_mask;
for(const auto r : button_rects) {
const auto c =
((switches_event & 1) ?
Color::red() :
((switches_debounced & 1) ?
Color::green() :
((switches_raw & 1) ?
Color::yellow() :
Color::blue()
)
)
);
painter.fill_rectangle(r + pos, c);
painter.fill_rectangle(r + pos, Color::blue());
}
const std::array<Rect, 8> raw_rects { {
{ 64 + 1, 32 + 1, 16 - 2, 16 - 2 }, // Right
{ 0 + 1, 32 + 1, 16 - 2, 16 - 2 }, // Left
{ 32 + 1, 64 + 1, 16 - 2, 16 - 2 }, // Down
{ 32 + 1, 0 + 1, 16 - 2, 16 - 2 }, // Up
{ 32 + 1, 32 + 1, 16 - 2, 16 - 2 }, // Select
{ 16 + 1, 96 + 1, 16 - 2, 16 - 2 }, // Encoder phase 0
{ 48 + 1, 96 + 1, 16 - 2, 16 - 2 }, // Encoder phase 1
{ 96 + 1, 0 + 1, 16 - 2, 16 - 2 }, // Dfu
} };
auto switches_raw = control::debug::switches();
for(const auto r : raw_rects) {
if (switches_raw & 1)
painter.fill_rectangle(r + pos, Color::yellow());
switches_raw >>= 1;
}
const std::array<Rect, 6> debounced_rects { {
{ 64 + 2, 32 + 2, 16 - 4, 16 - 4 }, // Right
{ 0 + 2, 32 + 2, 16 - 4, 16 - 4 }, // Left
{ 32 + 2, 64 + 2, 16 - 4, 16 - 4 }, // Down
{ 32 + 2, 0 + 2, 16 - 4, 16 - 4 }, // Up
{ 32 + 2, 32 + 2, 16 - 4, 16 - 4 }, // Select
{ 96 + 2, 0 + 2, 16 - 4, 16 - 4 }, // Dfu
} };
auto switches_debounced = get_switches_state().to_ulong();
for(const auto r : debounced_rects) {
if (switches_debounced & 1)
painter.fill_rectangle(r + pos, Color::green());
switches_debounced >>= 1;
}
const std::array<Rect, 6> events_rects { {
{ 64 + 3, 32 + 3, 16 - 6, 16 - 6 }, // Right
{ 0 + 3, 32 + 3, 16 - 6, 16 - 6 }, // Left
{ 32 + 3, 64 + 3, 16 - 6, 16 - 6 }, // Down
{ 32 + 3, 0 + 3, 16 - 6, 16 - 6 }, // Up
{ 32 + 3, 32 + 3, 16 - 6, 16 - 6 }, // Select
{ 96 + 3, 0 + 3, 16 - 6, 16 - 6 }, // Dfu
} };
auto switches_event = key_event_mask;
for(const auto r : events_rects) {
if (switches_event & 1)
painter.fill_rectangle(r + pos, Color::red());
switches_event >>= 1;
}
}
@@ -320,17 +360,19 @@ void DebugControlsView::focus() {
/* DebugPeripheralsMenuView **********************************************/
DebugPeripheralsMenuView::DebugPeripheralsMenuView(NavigationView& nav) {
const char * max283x = hackrf_r9 ? "MAX2839" : "MAX2837";
const char * si5351x = hackrf_r9 ? "Si5351A" : "Si5351C";
add_items({
{ "RFFC5072", ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav](){ nav.push<RegistersView>(
"RFFC5072", RegistersWidgetConfig { 31, 16 },
[](const size_t register_number) { return radio::debug::first_if::register_read(register_number); }
); } },
{ "MAX2837", ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav](){ nav.push<RegistersView>(
"MAX2837", RegistersWidgetConfig { 32, 10 },
{ max283x, ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav, max283x](){ nav.push<RegistersView>(
max283x, RegistersWidgetConfig { 32, 10 },
[](const size_t register_number) { return radio::debug::second_if::register_read(register_number); }
); } },
{ "Si5351C", ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav](){ nav.push<RegistersView>(
"Si5351C", RegistersWidgetConfig { 96, 8 },
{ si5351x, ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav, si5351x](){ nav.push<RegistersView>(
si5351x, RegistersWidgetConfig { 96, 8 },
[](const size_t register_number) { return portapack::clock_generator.read_register(register_number); }
); } },
{ audio::debug::codec_name(), ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav](){ nav.push<RegistersView>(
@@ -344,14 +386,17 @@ DebugPeripheralsMenuView::DebugPeripheralsMenuView(NavigationView& nav) {
/* DebugMenuView *********************************************************/
DebugMenuView::DebugMenuView(NavigationView& nav) {
if( portapack::persistent_memory::show_gui_return_icon() )
{
add_items( { { "..", ui::Color::light_grey(),&bitmap_icon_previous, [&nav](){ nav.pop(); } } } );
}
add_items({
//{ "..", ui::Color::light_grey(),&bitmap_icon_previous, [&nav](){ nav.pop(); } },
{ "Memory", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav](){ nav.push<DebugMemoryView>(); } },
//{ "Radio State", ui::Color::white(), nullptr, [&nav](){ nav.push<NotImplementedView>(); } },
{ "SD Card", ui::Color::dark_cyan(), &bitmap_icon_sdcard, [&nav](){ nav.push<SDCardDebugView>(); } },
{ "Peripherals", ui::Color::dark_cyan(), &bitmap_icon_peripherals, [&nav](){ nav.push<DebugPeripheralsMenuView>(); } },
{ "Temperature", ui::Color::dark_cyan(), &bitmap_icon_temperature, [&nav](){ nav.push<TemperatureView>(); } },
{ "Buttons test", ui::Color::dark_cyan(), &bitmap_icon_controls, [&nav](){ nav.push<DebugControlsView>(); } },
{ "Buttons Test", ui::Color::dark_cyan(), &bitmap_icon_controls, [&nav](){ nav.push<DebugControlsView>(); } },
});
set_max_rows(2); // allow wider buttons
}
+6 -1
View File
@@ -29,7 +29,6 @@
#include "ui_navigation.hpp"
#include "rffc507x.hpp"
#include "max2837.hpp"
#include "portapack.hpp"
#include <functional>
@@ -43,6 +42,8 @@ public:
void focus() override;
std::string title() const override { return "Memory"; };
private:
Text text_title {
{ 96, 96, 48, 16 },
@@ -113,6 +114,8 @@ public:
void focus() override;
std::string title() const override { return "Temperature"; };
private:
Text text_title {
{ 76, 16, 240, 16 },
@@ -252,6 +255,8 @@ public:
void focus() override;
std::string title() const override { return "Buttons Test"; };
private:
Text text_title {
{ 64, 16, 184, 16 },
+99
View File
@@ -0,0 +1,99 @@
/*
* Copyright (C) 2023 Bernd Herzog
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_dfu_menu.hpp"
#include "portapack_shared_memory.hpp"
#include "performance_counter.hpp"
namespace ui {
DfuMenu::DfuMenu(NavigationView& nav) : nav_ (nav) {
add_children({
&text_head,
&labels,
&text_info_line_1,
&text_info_line_2,
&text_info_line_3,
&text_info_line_4,
&text_info_line_5,
&text_info_line_6,
&text_info_line_7,
&text_info_line_8
});
}
void DfuMenu::paint(Painter& painter) {
auto utilisation = get_cpu_utilisation_in_percent();
text_info_line_1.set(to_string_dec_uint(chCoreStatus(), 6));
text_info_line_2.set(to_string_dec_uint((uint32_t)get_free_stack_space(), 6));
text_info_line_3.set(to_string_dec_uint(utilisation, 6));
text_info_line_4.set(to_string_dec_uint(shared_memory.m4_heap_usage, 6));
text_info_line_5.set(to_string_dec_uint(shared_memory.m4_stack_usage, 6));
text_info_line_6.set(to_string_dec_uint(shared_memory.m4_cpu_usage, 6));
text_info_line_7.set(to_string_dec_uint(shared_memory.m4_buffer_missed, 6));
text_info_line_8.set(to_string_dec_uint(chTimeNow()/1000, 6));
constexpr auto margin = 5;
constexpr auto lines = 8 + 2;
painter.fill_rectangle(
{
{6 * CHARACTER_WIDTH - margin, 3 * LINE_HEIGHT - margin},
{15 * CHARACTER_WIDTH + margin * 2, lines * LINE_HEIGHT + margin * 2}
},
ui::Color::black()
);
painter.fill_rectangle(
{
{5 * CHARACTER_WIDTH - margin, 3 * LINE_HEIGHT - margin},
{CHARACTER_WIDTH, lines * LINE_HEIGHT + margin * 2}
},
ui::Color::dark_cyan()
);
painter.fill_rectangle(
{
{21 * CHARACTER_WIDTH + margin, 3 * LINE_HEIGHT - margin},
{CHARACTER_WIDTH, lines * LINE_HEIGHT + margin * 2}
},
ui::Color::dark_cyan()
);
painter.fill_rectangle(
{
{5 * CHARACTER_WIDTH - margin, 3 * LINE_HEIGHT - margin - 8},
{17 * CHARACTER_WIDTH + margin * 2, 8}
},
ui::Color::dark_cyan()
);
painter.fill_rectangle(
{
{5 * CHARACTER_WIDTH - margin, (lines+3) * LINE_HEIGHT + margin},
{17 * CHARACTER_WIDTH + margin * 2, 8}
},
ui::Color::dark_cyan()
);
}
} /* namespace ui */
+73
View File
@@ -0,0 +1,73 @@
/*
* Copyright (C) 2023 Bernd Herzog
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef __UI_DFU_MENU_H__
#define __UI_DFU_MENU_H__
#include <cstdint>
#include "ui_widget.hpp"
#include "event_m0.hpp"
#include "debug.hpp"
#include "string_format.hpp"
#define LINE_HEIGHT 16
#define CHARACTER_WIDTH 8
namespace ui {
class NavigationView;
class DfuMenu : public View {
public:
DfuMenu(NavigationView& nav);
~DfuMenu() = default;
void paint(Painter& painter) override;
private:
NavigationView& nav_;
Text text_head {{ 6 * CHARACTER_WIDTH, 3 * LINE_HEIGHT, 11 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, "Performance"};
Labels labels {
{ { 6 * CHARACTER_WIDTH, 5 * LINE_HEIGHT }, "M0 heap:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH, 6 * LINE_HEIGHT }, "M0 stack:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH, 7 * LINE_HEIGHT }, "M0 cpu %:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH, 8 * LINE_HEIGHT }, "M4 heap:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH, 9 * LINE_HEIGHT }, "M4 stack:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH,10 * LINE_HEIGHT }, "M4 cpu %:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH,11 * LINE_HEIGHT }, "M4 miss:", Color::dark_cyan() },
{ { 6 * CHARACTER_WIDTH,12 * LINE_HEIGHT }, "uptime:", Color::dark_cyan() }
};
Text text_info_line_1 {{ 15 * CHARACTER_WIDTH, 5 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_2 {{ 15 * CHARACTER_WIDTH, 6 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_3 {{ 15 * CHARACTER_WIDTH, 7 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_4 {{ 15 * CHARACTER_WIDTH, 8 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_5 {{ 15 * CHARACTER_WIDTH, 9 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_6 {{ 15 * CHARACTER_WIDTH,10 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_7 {{ 15 * CHARACTER_WIDTH,11 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
Text text_info_line_8 {{ 15 * CHARACTER_WIDTH,12 * LINE_HEIGHT, 5 * CHARACTER_WIDTH, 1 * LINE_HEIGHT }, ""};
};
} /* namespace ui */
#endif/*__UI_DFU_MENU_H__*/
+97 -123
View File
@@ -24,6 +24,7 @@
#include "baseband_api.hpp"
#include "string_format.hpp"
#include "cpld_update.hpp"
using namespace portapack;
@@ -35,18 +36,21 @@ EncodersConfigView::EncodersConfigView(
using option_t = std::pair<std::string, int32_t>;
std::vector<option_t> enc_options;
size_t i;
set_parent_rect(parent_rect);
hidden(true);
// Default encoder def
encoder_def = &encoder_defs[0];
add_children({
&labels,
&options_enctype,
&field_repeat_min,
&field_clk,
&field_clk_step,
&field_frameduration,
&field_frameduration_step,
&symfield_word,
&text_format,
&waveform
@@ -55,18 +59,18 @@ EncodersConfigView::EncodersConfigView(
// Load encoder types in option field
for (i = 0; i < ENC_TYPES_COUNT; i++)
enc_options.emplace_back(std::make_pair(encoder_defs[i].name, i));
options_enctype.on_change = [this](size_t index, int32_t) {
on_type_change(index);
};
options_enctype.set_options(enc_options);
options_enctype.set_selected_index(0);
symfield_word.on_change = [this]() {
generate_frame();
};
// Selecting input clock changes symbol and word duration
field_clk.on_change = [this](int32_t value) {
// value is in kHz, new_value is in us
@@ -74,7 +78,11 @@ EncodersConfigView::EncodersConfigView(
if (new_value != field_frameduration.value())
field_frameduration.set_value(new_value * encoder_def->word_length, false);
};
field_clk_step.on_change = [this](size_t, int32_t value) {
field_clk.set_step(value);
};
// Selecting word duration changes input clock and symbol duration
field_frameduration.on_change = [this](int32_t value) {
// value is in us, new_value is in kHz
@@ -82,6 +90,10 @@ EncodersConfigView::EncodersConfigView(
if (new_value != field_clk.value())
field_clk.set_value(1000000 / new_value, false);
};
field_frameduration_step.on_change = [this](size_t, int32_t value) {
field_frameduration.set_step(value);
};
}
void EncodersConfigView::focus() {
@@ -96,7 +108,8 @@ void EncodersConfigView::on_type_change(size_t index) {
encoder_def = &encoder_defs[index];
field_clk.set_value(encoder_def->default_speed / 1000);
field_repeat_min.set_value(encoder_def->repeat_min);
// SymField setup
word_length = encoder_def->word_length;
symfield_word.set_length(word_length);
@@ -111,10 +124,10 @@ void EncodersConfigView::on_type_change(size_t index) {
format_string += 'D';
}
}
// Ugly :( Pad to erase
format_string.append(24 - format_string.size(), ' ');
text_format.set(format_string);
generate_frame();
@@ -130,28 +143,30 @@ void EncodersConfigView::draw_waveform() {
for (size_t n = 0; n < length; n++)
waveform_buffer[n] = (frame_fragments[n] == '0') ? 0 : 1;
waveform.set_length(length);
waveform.set_dirty();
}
void EncodersConfigView::generate_frame() {
size_t i = 0;
frame_fragments.clear();
for (auto c : encoder_def->word_format) {
if (c == 'S')
frame_fragments += encoder_def->sync;
else if (!c)
break;
else
frame_fragments += encoder_def->bit_format[symfield_word.get_sym(i++)];
}
draw_waveform();
}
uint8_t EncodersConfigView::repeat_min() {
return encoder_def->repeat_min;
return field_repeat_min.value();
}
uint32_t EncodersConfigView::samples_per_bit() {
@@ -163,7 +178,7 @@ uint32_t EncodersConfigView::pause_symbols() {
}
void EncodersScanView::focus() {
field_debug.focus();
field_length.focus();
}
EncodersScanView::EncodersScanView(
@@ -171,31 +186,17 @@ EncodersScanView::EncodersScanView(
) {
set_parent_rect(parent_rect);
hidden(true);
add_children({
&labels,
&field_debug,
&text_debug,
&text_length
&field_length,
&bit_length_10,
&bit_length
});
// DEBUG
field_debug.on_change = [this](int32_t value) {
uint32_t l;
size_t length;
de_bruijn debruijn_seq;
length = debruijn_seq.init(value);
l = 1;
l <<= value;
l--;
if (l > 25)
l = 25;
text_debug.set(to_string_bin(debruijn_seq.compute(l), 25));
text_length.set(to_string_dec_uint(length));
};
field_length.set_value(8);
bit_length_10.set_value(40);
bit_length.set_value(0);
}
void EncodersView::focus() {
@@ -203,30 +204,22 @@ void EncodersView::focus() {
}
EncodersView::~EncodersView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_ook", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // ghost signal c/m to the problem at the exit .
baseband::shutdown(); // better this function after load_sram()
}
void EncodersView::update_progress() {
std::string str_buffer;
// text_status.set(" ");
if (tx_mode == SINGLE) {
if (tx_mode == SINGLE || tx_mode == SCAN) {
str_buffer = to_string_dec_uint(repeat_index) + "/" + to_string_dec_uint(repeat_min);
text_status.set(str_buffer);
progressbar.set_value(repeat_index);
/*} else if (tx_mode == SCAN) {
strcpy(str, to_string_dec_uint(repeat_index).c_str());
strcat(str, "/");
strcat(str, to_string_dec_uint(portapack::persistent_memory::afsk_repeats()).c_str());
strcat(str, " ");
strcat(str, to_string_dec_uint(scan_index + 1).c_str());
strcat(str, "/");
strcat(str, to_string_dec_uint(scan_count).c_str());
text_status.set(str);
progress.set_value(scan_progress);*/
} else {
text_status.set("Ready");
progressbar.set_value(0);
@@ -234,89 +227,59 @@ void EncodersView::update_progress() {
}
void EncodersView::on_tx_progress(const uint32_t progress, const bool done) {
//char str[16];
if (!done) {
// Repeating...
repeat_index = progress + 1;
/*if (tx_mode == SCAN) {
scan_progress++;
update_progress();
} else {*/
update_progress();
//}
update_progress();
} else {
// make sure all samples are transmitted before disabling radio
chThdSleepMilliseconds(10);
// Done transmitting
/*if ((tx_mode == SCAN) && (scan_index < (scan_count - 1))) {
transmitter_model.disable();
if (abort_scan) {
// Kill scan process
strcpy(str, "Abort @");
strcat(str, rgsb);
text_status.set(str);
progress.set_value(0);
tx_mode = IDLE;
abort_scan = false;
button_scan.set_style(&style_val);
button_scan.set_text("SCAN");
} else {
// Next address
scan_index++;
strcpy(rgsb, &scan_list[options_scanlist.selected_index()].addresses[scan_index * 5]);
scan_progress++;
repeat_index = 1;
update_progress();
start_tx(true);
}
} else {*/
transmitter_model.disable();
tx_mode = IDLE;
text_status.set("Done");
progressbar.set_value(0);
tx_view.set_transmitting(false);
//}
transmitter_model.disable();
tx_mode = IDLE;
text_status.set("Done");
progressbar.set_value(0);
tx_view.set_transmitting(false);
}
}
void EncodersView::start_tx(const bool scan) {
(void)scan;
size_t bitstream_length = 0;
repeat_min = view_config.repeat_min();
/*if (scan) {
if (tx_mode != SCAN) {
scan_index = 0;
scan_count = scan_list[options_scanlist.selected_index()].count;
scan_progress = 1;
repeat_index = 1;
tx_mode = SCAN;
strcpy(rgsb, &scan_list[options_scanlist.selected_index()].addresses[0]);
progress.set_max(scan_count * afsk_repeats);
update_progress();
}
} else {*/
int scan_width = 0;
uint32_t samples_per_bit;
if (scan) {
tx_mode = SCAN;
scan_width = view_scan.field_length.value();
samples_per_bit =
((view_scan.bit_length_10.value() * 10 + view_scan.bit_length.value()) * OOK_SAMPLERATE) / 1000000UL;
constexpr auto sym_len = 4;
const uint32_t seq_len = ((1 << (scan_width - 1)) * 2) * ((uint64_t) samples_per_bit) * sym_len / 2048UL;
progressbar.set_max(seq_len);
repeat_min = seq_len;
} else {
tx_mode = SINGLE;
repeat_index = 1;
samples_per_bit = view_config.samples_per_bit();
view_config.generate_frame();
bitstream_length = make_bitstream(view_config.frame_fragments);
progressbar.set_max(repeat_min);
update_progress();
//}
view_config.generate_frame();
bitstream_length = make_bitstream(view_config.frame_fragments);
repeat_min = view_config.repeat_min();
}
repeat_index = 1;
update_progress();
transmitter_model.set_sampling_rate(OOK_SAMPLERATE);
transmitter_model.set_rf_amp(true);
transmitter_model.set_baseband_bandwidth(1750000);
transmitter_model.enable();
baseband::set_ook_data(
bitstream_length,
view_config.samples_per_bit(),
samples_per_bit,
repeat_min,
view_config.pause_symbols()
view_config.pause_symbols(),
scan_width
);
}
@@ -334,21 +297,32 @@ EncodersView::EncodersView(
&progressbar,
&tx_view
});
// load app settings
auto rc = settings.load("tx_ook", &app_settings);
if (rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
tx_view.on_edit_frequency = [this, &nav]() {
auto new_view = nav.push<FrequencyKeypadView>(transmitter_model.tuning_frequency());
new_view->on_changed = [this](rf::Frequency f) {
transmitter_model.set_tuning_frequency(f);
};
};
tx_view.on_start = [this]() {
tx_view.set_transmitting(true);
start_tx(false);
start_tx(tab_view.selected());
};
tx_view.on_stop = [this]() {
tx_view.set_transmitting(false);
baseband::kill_ook();
transmitter_model.disable();
};
}
+101 -64
View File
@@ -26,6 +26,7 @@
#include "transmitter_model.hpp"
#include "encoders.hpp"
#include "de_bruijn.hpp"
#include "app_settings.hpp"
using namespace encoders;
@@ -34,43 +35,41 @@ namespace ui {
class EncodersConfigView : public View {
public:
EncodersConfigView(NavigationView& nav, Rect parent_rect);
EncodersConfigView(const EncodersConfigView&) = delete;
EncodersConfigView(EncodersConfigView&&) = delete;
EncodersConfigView& operator=(const EncodersConfigView&) = delete;
EncodersConfigView& operator=(EncodersConfigView&&) = delete;
void focus() override;
void on_show() override;
uint8_t repeat_min();
uint32_t samples_per_bit();
uint32_t pause_symbols();
void generate_frame();
std::string frame_fragments = "0";
private:
//bool abort_scan = false;
//uint8_t scan_count;
//double scan_progress;
//unsigned int scan_index;
int16_t waveform_buffer[550];
const encoder_def_t * encoder_def { };
//uint8_t enc_type = 0;
void draw_waveform();
void on_bitfield();
void on_type_change(size_t index);
Labels labels {
{ { 1 * 8, 0 }, "Type:", Color::light_grey() },
{ { 16 * 8, 0 }, "Clk:", Color::light_grey() },
{ { 24 * 8, 0 }, "kHz", Color::light_grey() },
{ { 14 * 8, 2 * 8 }, "Frame:", Color::light_grey() },
{ { 26 * 8, 2 * 8 }, "us", Color::light_grey() },
{ { 2 * 8, 4 * 8 }, "Symbols:", Color::light_grey() },
{ { 1 * 8, 11 * 8 }, "Waveform:", Color::light_grey() }
{ { 17 * 8, 0 }, "Repeat:", Color::light_grey() },
{ { 1 * 8, 2 * 8 }, "Clk:", Color::light_grey() },
{ { 10 * 8, 2 * 8 }, "kHz", Color::light_grey() },
{ { 17 * 8, 2 * 8 }, "Step:", Color::light_grey() },
{ { 1 * 8, 4 * 8 }, "Frame:", Color::light_grey() },
{ { 13 * 8, 4 * 8 }, "us", Color::light_grey() },
{ { 17 * 8, 4 * 8 }, "Step:", Color::light_grey() },
{ { 2 * 8, 7 * 8 }, "Symbols:", Color::light_grey() },
{ { 1 * 8, 14 * 8 }, "Waveform:", Color::light_grey() }
};
OptionsField options_enctype { // Options are loaded at runtime
@@ -81,34 +80,63 @@ private:
};
NumberField field_clk {
{ 21 * 8, 0 },
3,
{ 1, 500 },
{ 5 * 8, 2 * 8 },
4,
{ 1, 1000 },
1,
' '
};
NumberField field_repeat_min {
{ 24 * 8, 0 },
2,
{ 1, 99 },
1,
' '
};
OptionsField field_clk_step {
{ 22 * 8, 2 * 8 },
7,
{
{ "1", 1 },
{ "10", 10 },
{ "100", 100 }
}
};
NumberField field_frameduration {
{ 21 * 8, 2 * 8 },
{ 7 * 8, 4 * 8 },
5,
{ 300, 99999 },
100,
' '
};
OptionsField field_frameduration_step {
{ 22 * 8, 4 * 8 },
7,
{
{ "1", 1 },
{ "10", 10 },
{ "100", 100 },
{ "1000", 1000 }
}
};
SymField symfield_word {
{ 2 * 8, 6 * 8 },
{ 2 * 8, 9 * 8 },
20,
SymField::SYMFIELD_DEF
};
Text text_format {
{ 2 * 8, 8 * 8, 24 * 8, 16 },
{ 2 * 8, 11 * 8, 24 * 8, 16 },
""
};
Waveform waveform {
{ 0, 14 * 8, 240, 32 },
{ 0, 17 * 8, 240, 32 },
waveform_buffer,
0,
0,
@@ -121,33 +149,38 @@ private:
class EncodersScanView : public View {
public:
EncodersScanView(NavigationView& nav, Rect parent_rect);
NumberField field_length {
{ 8 * 8, 0 },
2,
{ 3, 24 },
1,
' '
};
NumberField bit_length_10 {
{ 12 * 8, 2 * 8 },
2,
{ 1, 88 },
1,
' '
};
NumberField bit_length {
{ 14 * 8, 2 * 8 },
1,
{ 0, 9 },
1,
' '
};
void focus() override;
private:
Labels labels {
{ { 1 * 8, 1 * 8 }, "Coming soon...", Color::light_grey() }
};
// DEBUG
NumberField field_debug {
{ 1 * 8, 6 * 8 },
2,
{ 3, 16 },
1,
' '
};
// DEBUG
Text text_debug {
{ 1 * 8, 8 * 8, 24 * 8, 16 },
""
};
// DEBUG
Text text_length {
{ 1 * 8, 10 * 8, 24 * 8, 16 },
""
{ { 1 * 8, 0 * 8 }, "Length:", Color::light_grey() },
{ { 1 * 8, 2 * 8 }, "Bit length:", Color::light_grey() },
{ { 16 * 8, 2 * 8 }, "us", Color::light_grey() },
};
};
@@ -155,10 +188,10 @@ class EncodersView : public View {
public:
EncodersView(NavigationView& nav);
~EncodersView();
void focus() override;
std::string title() const override { return "OOK transmit"; };
std::string title() const override { return "OOK TX"; };
private:
NavigationView& nav_;
@@ -168,15 +201,19 @@ private:
SINGLE,
SCAN
};
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
tx_modes tx_mode = IDLE;
uint8_t repeat_index { 0 };
uint8_t repeat_min { 0 };
uint32_t repeat_index { 0 };
uint32_t repeat_min { 0 };
void update_progress();
void start_tx(const bool scan);
void on_tx_progress(const uint32_t progress, const bool done);
/*const Style style_address {
.font = font::fixed_8x16,
.background = Color::black(),
@@ -187,32 +224,32 @@ private:
.background = Color::black(),
.foreground = Color::blue(),
};*/
Rect view_rect = { 0, 4 * 8, 240, 168 };
EncodersConfigView view_config { nav_, view_rect };
EncodersScanView view_scan { nav_, view_rect };
TabView tab_view {
{ "Config", Color::cyan(), &view_config },
{ "Scan", Color::green(), &view_scan },
{ "de Bruijn", Color::green(), &view_scan },
};
Text text_status {
{ 2 * 8, 13 * 16, 128, 16 },
"Ready"
};
ProgressBar progressbar {
{ 2 * 8, 13 * 16 + 20, 208, 16 }
};
TransmitterView tx_view {
16 * 16,
50000,
9
};
MessageHandlerRegistration message_handler_tx_progress {
Message::ID::TXProgress,
[this](const Message* const p) {
+306 -147
View File
@@ -20,72 +20,173 @@
* Boston, MA 02110-1301, USA.
*/
/* TODO:
* - Paging menu items
* - Copy/Move
*/
#include <algorithm>
#include "ui_fileman.hpp"
#include "string_format.hpp"
#include "portapack.hpp"
#include "event_m0.hpp"
using namespace portapack;
namespace fs = std::filesystem;
namespace {
using namespace ui;
bool is_hidden_file(const fs::path& path) {
return !path.empty() && path.native()[0] == u'.';
}
// Gets a truncated name from a path for display.
std::string truncate(const fs::path& path, size_t max_length) {
auto name = path.string();
return name.length() <= max_length ? name : name.substr(0, max_length);
}
// Gets a human readable file size string.
std::string get_pretty_size(uint32_t file_size) {
static const std::string suffix[5] = { "B", "kB", "MB", "GB", "??" };
size_t suffix_index = 0;
while (file_size >= 1024) {
file_size /= 1024;
suffix_index++;
}
if (suffix_index > 4)
suffix_index = 4;
return to_string_dec_uint(file_size) + suffix[suffix_index];
}
// Case insensitive path equality on underlying "native" string.
bool iequal(
const fs::path& lhs,
const fs::path& rhs
) {
const auto& lhs_str = lhs.native();
const auto& rhs_str = rhs.native();
// NB: Not correct for Unicode/locales.
if (lhs_str.length() == rhs_str.length()) {
for (size_t i = 0; i < lhs_str.length(); ++i)
if (towupper(lhs_str[i]) != towupper(rhs_str[i]))
return false;
return true;
}
return false;
}
// Inserts the entry into the entry list sorted directories first then by file name.
void insert_sorted(std::vector<fileman_entry>& entries, fileman_entry&& entry) {
auto it = std::lower_bound(std::begin(entries), std::end(entries), entry,
[](const fileman_entry& lhs, const fileman_entry& rhs) {
if (lhs.is_directory && !rhs.is_directory)
return true;
else if (!lhs.is_directory && rhs.is_directory)
return false;
else
return lhs.path < rhs.path;
});
entries.insert(it, std::move(entry));
}
// Returns the partner file path or an empty path if no partner is found.
fs::path get_partner_file(fs::path path) {
if (fs::is_directory(path))
return { };
const fs::path txt_path{ u".TXT" };
const fs::path c16_path{ u".C16" };
auto ext = path.extension();
if (iequal(ext, txt_path))
ext = c16_path;
else if (iequal(ext, c16_path))
ext = txt_path;
else
return { };
path.replace_extension(ext);
return fs::file_exists(path) && !fs::is_directory(path) ? path : fs::path{ };
}
// Modal prompt to update the partner file if it exists.
// Runs continuation on_partner_action to update the partner file.
// Returns true is a partner is found, otherwise false.
// Path must be the full path to the file.
bool partner_file_prompt(
NavigationView& nav,
const fs::path& path,
std::string action_name,
std::function<void(const fs::path&, bool)> on_partner_action
) {
auto partner = get_partner_file(path);
if (partner.empty())
return false;
nav.push_under_current<ModalMessageView>(
"Partner File",
partner.filename().string() + "\n" + action_name + " this file too?",
YESNO,
[&nav, partner, on_partner_action](bool choice) {
if (on_partner_action)
on_partner_action(partner, choice);
}
);
return true;
}
}
namespace ui {
void FileManBaseView::load_directory_contents(const std::filesystem::path& dir_path) {
/* FileManBaseView ***********************************************************/
void FileManBaseView::load_directory_contents(const fs::path& dir_path) {
current_path = dir_path;
text_current.set(dir_path.string().length()? dir_path.string().substr(0, 30 - 6):"(sd root)");
entry_list.clear();
auto filtering = (bool)extension_filter.size();
// List directories and files, put directories up top
if (dir_path.string().length())
entry_list.push_back({ u"..", 0, true });
auto filtering = !extension_filter.empty();
for (const auto& entry : std::filesystem::directory_iterator(dir_path, u"*")) {
text_current.set(dir_path.empty() ? "(sd root)" : truncate(dir_path, 24));
for (const auto& entry : fs::directory_iterator(dir_path, u"*")) {
// Hide files starting with '.' (hidden / tmp).
if (is_hidden_file(entry.path()))
continue;
// do not display dir / files starting with '.' (hidden / tmp)
if (entry.path().string().length() && entry.path().filename().string()[0] != '.') {
if (std::filesystem::is_regular_file(entry.status())) {
bool matched = true;
if (filtering) {
auto entry_extension = entry.path().extension().string();
for (auto &c: entry_extension)
c = toupper(c);
if (entry_extension != extension_filter)
matched = false;
}
if (matched)
entry_list.push_back({ entry.path(), (uint32_t)entry.size(), false });
} else if (std::filesystem::is_directory(entry.status())) {
entry_list.insert(entry_list.begin(), { entry.path(), 0, true });
}
if (fs::is_regular_file(entry.status())) {
if (!filtering || iequal(entry.path().extension(), extension_filter))
insert_sorted(entry_list, { entry.path(), (uint32_t)entry.size(), false });
} else if (fs::is_directory(entry.status())) {
insert_sorted(entry_list, { entry.path(), 0, true });
}
}
// Add "parent" directory if not at the root.
if (!dir_path.empty())
entry_list.insert(entry_list.begin(), { parent_dir_path, 0, true });
}
std::filesystem::path FileManBaseView::get_selected_path() {
auto selected_path_str = current_path.string();
auto entry_path = entry_list[menu_view.highlighted_index()].entry_path.string();
if (entry_path == "..") {
selected_path_str = get_parent_dir().string();
} else {
if (selected_path_str.back() != '/')
selected_path_str += '/';
selected_path_str += entry_path;
}
return selected_path_str;
fs::path FileManBaseView::get_selected_full_path() const {
if (get_selected_entry().path == parent_dir_path)
return current_path.parent_path();
return current_path / get_selected_entry().path;
}
std::filesystem::path FileManBaseView::get_parent_dir() {
auto current_path_str = current_path.string();
return current_path.string().substr(0, current_path_str.find_last_of('/'));
const fileman_entry& FileManBaseView::get_selected_entry() const {
// TODO: return reference to an "empty" entry on OOB?
return entry_list[menu_view.highlighted_index()];
}
FileManBaseView::FileManBaseView(
@@ -105,20 +206,20 @@ FileManBaseView::FileManBaseView(
};
if (!sdcIsCardInserted(&SDCD1)) {
empty_root=true;
empty_root = true;
text_current.set("NO SD CARD!");
return;
}
load_directory_contents(current_path);
if (!entry_list.size()) {
empty_root = true;
text_current.set("EMPTY SD CARD!");
} else {
load_directory_contents(current_path);
if (!entry_list.size())
{
empty_root = true;
text_current.set("EMPTY SD CARD!");
} else {
menu_view.on_left = [&nav, this]() {
load_directory_contents(get_parent_dir());
refresh_list();
};
}
menu_view.on_left = [this]() {
pop_dir();
};
}
}
@@ -130,67 +231,83 @@ void FileManBaseView::focus() {
}
}
void FileManBaseView::push_dir(const fs::path& path) {
if (path == parent_dir_path) {
pop_dir();
} else {
current_path /= path;
saved_index_stack.push_back(menu_view.highlighted_index());
menu_view.set_highlighted(0);
reload_current();
}
}
void FileManBaseView::pop_dir() {
if (saved_index_stack.empty())
return;
current_path = current_path.parent_path();
reload_current();
menu_view.set_highlighted(saved_index_stack.back());
saved_index_stack.pop_back();
}
void FileManBaseView::refresh_list() {
if (on_refresh_widgets)
on_refresh_widgets(false);
auto prev_highlight = menu_view.highlighted_index();
menu_view.clear();
for (size_t n = 0; n < entry_list.size(); n++) {
auto entry = &entry_list[n];
auto entry_name = entry->entry_path.filename().string().substr(0, 20);
if (entry->is_directory) {
for (const auto& entry : entry_list) {
auto entry_name = truncate(entry.path, 20);
if (entry.is_directory) {
menu_view.add_item({
entry_name,
ui::Color::yellow(),
&bitmap_icon_dir,
[this](){
[this](KeyEvent key) {
if (on_select_entry)
on_select_entry();
on_select_entry(key);
}
});
} else {
auto file_size = entry->size;
size_t suffix_index = 0;
while (file_size >= 1024) {
file_size /= 1024;
suffix_index++;
}
if (suffix_index > 4)
suffix_index = 4;
std::string size_str = to_string_dec_uint(file_size) + suffix[suffix_index];
auto entry_extension = entry->entry_path.extension().string();
for (auto &c: entry_extension)
c = toupper(c);
// Associate extension to icon and color
size_t c;
for (c = 0; c < file_types.size() - 1; c++) {
if (entry_extension == file_types[c].extension)
break;
}
const auto& assoc = get_assoc(entry.path.extension());
auto size_str = get_pretty_size(entry.size);
menu_view.add_item({
entry_name + std::string(21 - entry_name.length(), ' ') + size_str,
file_types[c].color,
file_types[c].icon,
[this](){
assoc.color,
assoc.icon,
[this](KeyEvent key) {
if (on_select_entry)
on_select_entry();
on_select_entry(key);
}
});
}
}
menu_view.set_highlighted(0); // Refresh
menu_view.set_highlighted(prev_highlight);
}
void FileManBaseView::reload_current() {
load_directory_contents(current_path);
refresh_list();
}
const FileManBaseView::file_assoc_t& FileManBaseView::get_assoc(
const fs::path& ext) const
{
size_t index = 0;
for (; index < file_types.size() - 1; ++index)
if (iequal(ext, file_types[index].extension))
return file_types[index];
// Default to last entry in the list.
return file_types[index];
}
/*void FileSaveView::on_save_name() {
@@ -215,7 +332,9 @@ FileSaveView::FileSaveView(
};
}*/
void FileLoadView::refresh_widgets(const bool v) {
/* FileLoadView **************************************************************/
void FileLoadView::refresh_widgets(const bool) {
set_dirty();
}
@@ -237,45 +356,92 @@ FileLoadView::FileLoadView(
refresh_list();
on_select_entry = [&nav, this]() {
if (entry_list[menu_view.highlighted_index()].is_directory) {
load_directory_contents(get_selected_path());
refresh_list();
on_select_entry = [this](KeyEvent) {
if (get_selected_entry().is_directory) {
push_dir(get_selected_entry().path);
} else {
nav_.pop();
if (on_changed)
on_changed(current_path.string() + '/' + entry_list[menu_view.highlighted_index()].entry_path.string());
on_changed(get_selected_full_path());
}
};
}
void FileManagerView::on_rename(NavigationView& nav) {
text_prompt(nav, name_buffer, max_filename_length, [this](std::string& buffer) {
std::string destination_path = current_path.string();
if (destination_path.back() != '/')
destination_path += '/';
destination_path = destination_path + buffer;
rename_file(get_selected_path(), destination_path);
load_directory_contents(current_path);
refresh_list();
});
/* FileManagerView ***********************************************************/
void FileManagerView::on_rename() {
auto& entry = get_selected_entry();
name_buffer = entry.path.filename().string();
uint32_t cursor_pos = (uint32_t)name_buffer.length();
if (auto pos = name_buffer.find_last_of(".");
pos != name_buffer.npos && !entry.is_directory)
cursor_pos = pos;
text_prompt(nav_, name_buffer, cursor_pos, max_filename_length,
[this](std::string& renamed) {
auto renamed_path = fs::path{ renamed };
rename_file(get_selected_full_path(), current_path / renamed_path);
auto has_partner = partner_file_prompt(nav_, get_selected_full_path(), "Rename",
[this, renamed_path](const fs::path& partner, bool should_rename) mutable {
if (should_rename) {
auto new_name = renamed_path.replace_extension(partner.extension());
rename_file(current_path / partner, current_path / new_name);
}
reload_current();
}
);
if (!has_partner)
reload_current();
});
}
void FileManagerView::on_delete() {
delete_file(get_selected_path());
load_directory_contents(current_path);
refresh_list();
auto name = get_selected_entry().path.filename().string();
nav_.push<ModalMessageView>("Delete", "Delete " + name + "\nAre you sure?", YESNO,
[this](bool choice) {
if (choice) {
delete_file(get_selected_full_path());
auto has_partner = partner_file_prompt(
nav_, get_selected_full_path(), "Delete",
[this](const fs::path& partner, bool should_delete) {
if (should_delete)
delete_file(current_path / partner);
reload_current();
}
);
if (!has_partner)
reload_current();
}
}
);
}
void FileManagerView::on_new_dir() {
name_buffer = "";
text_prompt(nav_, name_buffer, max_filename_length, [this](std::string& dir_name) {
make_new_directory(current_path / dir_name);
reload_current();
});
}
bool FileManagerView::selected_is_valid() const {
return !entry_list.empty() &&
get_selected_entry().path != parent_dir_path;
}
void FileManagerView::refresh_widgets(const bool v) {
button_rename.hidden(v);
button_new_dir.hidden(v);
button_delete.hidden(v);
button_new_dir.hidden(v);
set_dirty();
}
FileManagerView::~FileManagerView() {
// Flush ?
}
FileManagerView::FileManagerView(
@@ -292,47 +458,40 @@ FileManagerView::FileManagerView(
&labels,
&text_date,
&button_rename,
&button_delete,
&button_new_dir,
&button_delete
});
menu_view.on_highlight = [this]() {
text_date.set(to_string_FAT_timestamp(file_created_date(get_selected_path())));
// TODO: enable/disable buttons.
if (selected_is_valid())
text_date.set(to_string_FAT_timestamp(file_created_date(get_selected_full_path())));
else
text_date.set("");
};
refresh_list();
on_select_entry = [this]() {
if (entry_list[menu_view.highlighted_index()].is_directory) {
load_directory_contents(get_selected_path());
refresh_list();
} else
on_select_entry = [this](KeyEvent key) {
if (key == KeyEvent::Select && get_selected_entry().is_directory) {
push_dir(get_selected_entry().path);
} else {
button_rename.focus();
}
};
button_new_dir.on_select = [this, &nav](Button&) {
name_buffer.clear();
text_prompt(nav, name_buffer, max_filename_length, [this](std::string& buffer) {
make_new_directory(current_path.string() + '/' + buffer);
load_directory_contents(current_path);
refresh_list();
});
button_rename.on_select = [this](Button&) {
if (selected_is_valid())
on_rename();
};
button_rename.on_select = [this, &nav](Button&) {
name_buffer = entry_list[menu_view.highlighted_index()].entry_path.filename().string().substr(0, max_filename_length);
on_rename(nav);
button_delete.on_select = [this](Button&) {
if (selected_is_valid())
on_delete();
};
button_delete.on_select = [this, &nav](Button&) {
// Use display_modal ?
nav.push<ModalMessageView>("Delete", "Delete " + entry_list[menu_view.highlighted_index()].entry_path.filename().string() + "\nAre you sure?", YESNO,
[this](bool choice) {
if (choice)
on_delete();
}
);
button_new_dir.on_select = [this](Button&) {
on_new_dir();
};
}
}
+46 -35
View File
@@ -31,7 +31,7 @@
namespace ui {
struct fileman_entry {
std::filesystem::path entry_path { };
std::filesystem::path path { };
uint32_t size { };
bool is_directory { };
};
@@ -43,50 +43,56 @@ public:
std::string filter
);
void focus() override;
void load_directory_contents(const std::filesystem::path& dir_path);
std::filesystem::path get_selected_path();
std::string title() const override { return "File manager"; };
void focus() override;
std::string title() const override { return "Fileman"; };
protected:
NavigationView& nav_;
static constexpr size_t max_filename_length = 30 - 2;
const std::string suffix[5] = { "B", "kB", "MB", "GB", "??" };
static constexpr size_t max_filename_length = 50;
struct file_assoc_t {
std::string extension;
std::filesystem::path extension;
const Bitmap* icon;
ui::Color color;
};
const std::vector<file_assoc_t> file_types = {
{ ".TXT", &bitmap_icon_file_text, ui::Color::white() },
{ ".PNG", &bitmap_icon_file_image, ui::Color::green() },
{ ".BMP", &bitmap_icon_file_image, ui::Color::green() },
{ ".C8", &bitmap_icon_file_iq, ui::Color::blue() },
{ ".C16", &bitmap_icon_file_iq, ui::Color::blue() },
{ ".WAV", &bitmap_icon_file_wav, ui::Color::dark_magenta() },
{ "", &bitmap_icon_file, ui::Color::light_grey() }
{ u".TXT", &bitmap_icon_file_text, ui::Color::white() },
{ u".PNG", &bitmap_icon_file_image, ui::Color::green() },
{ u".BMP", &bitmap_icon_file_image, ui::Color::green() },
{ u".C8", &bitmap_icon_file_iq, ui::Color::dark_cyan() },
{ u".C16", &bitmap_icon_file_iq, ui::Color::dark_cyan() },
{ u".WAV", &bitmap_icon_file_wav, ui::Color::dark_magenta() },
{ u"", &bitmap_icon_file, ui::Color::light_grey() } // NB: Must be last.
};
bool empty_root { false };
std::function<void(void)> on_select_entry { nullptr };
std::function<void(bool)> on_refresh_widgets { nullptr };
std::vector<fileman_entry> entry_list { };
std::filesystem::path current_path { u"" };
std::string extension_filter { "" };
void change_category(int32_t category_id);
std::filesystem::path get_parent_dir();
std::filesystem::path get_selected_full_path() const;
const fileman_entry& get_selected_entry() const;
void push_dir(const std::filesystem::path& path);
void pop_dir();
void refresh_list();
void reload_current();
void load_directory_contents(const std::filesystem::path& dir_path);
const file_assoc_t& get_assoc(const std::filesystem::path& ext) const;
NavigationView& nav_;
bool empty_root { false };
std::function<void(KeyEvent)> on_select_entry { nullptr };
std::function<void(bool)> on_refresh_widgets { nullptr };
const std::filesystem::path parent_dir_path { u".." };
std::filesystem::path current_path { u"" };
std::filesystem::path extension_filter { u"" };
std::vector<fileman_entry> entry_list { };
std::vector<uint32_t> saved_index_stack { };
Labels labels {
{ { 0, 0 }, "Path:", Color::light_grey() }
};
Text text_current {
{ 6 * 8, 0 * 8, 24 * 8, 16 },
"",
@@ -142,11 +148,16 @@ public:
~FileManagerView();
private:
// Passed by ref to other views needing lifetime extension.
std::string name_buffer { };
void refresh_widgets(const bool v);
void on_rename(NavigationView& nav);
void on_rename();
void on_delete();
void on_new_dir();
// True if the selected entry is a real file item.
bool selected_is_valid() const;
Labels labels {
{ { 0, 26 * 8 }, "Created ", Color::light_grey() }
@@ -161,16 +172,16 @@ private:
{ 0 * 8, 29 * 8, 14 * 8, 32 },
"Rename"
};
Button button_delete {
{ 16 * 8, 29 * 8, 14 * 8, 32 },
"Delete"
};
Button button_new_dir {
{ 0 * 8, 34 * 8, 14 * 8, 32 },
"New dir"
"New Dir"
};
};
} /* namespace ui */
@@ -0,0 +1,89 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2023 Bernd Herzog
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_flash_utility.hpp"
#include "portapack_shared_memory.hpp"
namespace ui {
Thread* FlashUtilityView::thread { nullptr };
static constexpr size_t max_filename_length = 26;
FlashUtilityView::FlashUtilityView(NavigationView& nav) : nav_ (nav) {
add_children({
&labels,
&menu_view
});
menu_view.set_parent_rect({ 0, 3 * 8, 240, 33 * 8 });
for (const auto& entry : std::filesystem::directory_iterator(u"FIRMWARE", u"*.bin")) {
auto filename = entry.path().filename();
auto path = entry.path().native();
menu_view.add_item({
filename.string().substr(0, max_filename_length),
ui::Color::red(),
&bitmap_icon_temperature,
[this, path](KeyEvent) {
this->firmware_selected(path);
}
});
}
}
void FlashUtilityView::firmware_selected(std::filesystem::path::string_type path) {
nav_.push<ModalMessageView>(
"Warning!",
"This will replace your\ncurrent firmware.\n\nIf things go wrong you are\nrequired to flash manually\nwith dfu.",
YESNO,
[this, path](bool choice) {
if (choice) {
std::u16string full_path = std::u16string(u"FIRMWARE/") + path;
this->flash_firmware(full_path);
}
}
);
}
void FlashUtilityView::flash_firmware(std::filesystem::path::string_type path) {
ui::Painter painter;
painter.fill_rectangle(
{ 0, 0, portapack::display.width(), portapack::display.height() },
ui::Color::black()
);
painter.draw_string({ 12, 24 }, this->nav_.style(), "This will take 15 seconds.");
painter.draw_string({ 12, 64 }, this->nav_.style(), "Please wait while LEDs RX");
painter.draw_string({ 12, 84 }, this->nav_.style(), "and TX are flashing.");
painter.draw_string({ 12, 124 }, this->nav_.style(), "Then restart the device.");
std::memcpy(&shared_memory.bb_data.data[0], path.c_str(), (path.length() + 1) * 2);
m4_init(portapack::spi_flash::image_tag_flash_utility, portapack::memory::map::m4_code, false);
m0_halt();
}
void FlashUtilityView::focus() {
menu_view.focus();
}
} /* namespace ui */
@@ -0,0 +1,66 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2023 Bernd Herzog
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef __UI_FLSH_UITILTY_H__
#define __UI_FLSH_UITILTY_H__
#include "ui_widget.hpp"
#include "ui_navigation.hpp"
#include "string_format.hpp"
#include "ff.h"
#include "baseband_api.hpp"
#include "core_control.hpp"
#include <cstdint>
namespace ui {
class FlashUtilityView : public View {
public:
FlashUtilityView(NavigationView& nav);
void focus() override;
std::string title() const override { return "Flash Utility"; };
private:
NavigationView& nav_;
bool confirmed = false;
static Thread* thread;
Labels labels {
{ { 4, 4 }, "Select firmware to flash:", Color::white() }
};
MenuView menu_view {
{ 0, 2 * 8, 240, 26 * 8 },
true
};
void firmware_selected(std::filesystem::path::string_type path);
void flash_firmware(std::filesystem::path::string_type path);
};
} /* namespace ui */
#endif/*__UI_FLSH_UITILTY_H__*/
+4 -1
View File
@@ -48,6 +48,9 @@ FreqManBaseView::FreqManBaseView(
} else
error_ = ERROR_NOFILES;
// initialize
change_category(last_category_id);
// Default function
on_change_category = [this](int32_t category_id) {
change_category(category_id);
@@ -117,7 +120,7 @@ void FreqManBaseView::refresh_list() {
freqman_item_string(database[n], 30),
ui::Color::white(),
nullptr,
[this](){
[this](KeyEvent){
if (on_select_frequency)
on_select_frequency();
}
+8 -8
View File
@@ -64,7 +64,7 @@ protected:
OptionsField options_category {
{ 9 * 8, 4 },
12,
14,
{ }
};
@@ -87,7 +87,7 @@ class FrequencySaveView : public FreqManBaseView {
public:
FrequencySaveView(NavigationView& nav, const rf::Frequency value);
std::string title() const override { return "Save frequency"; };
std::string title() const override { return "Save freq."; };
private:
std::string desc_buffer { };
@@ -103,19 +103,19 @@ private:
};
Labels labels {
{ { 2 * 8, 14 * 8 }, "Save as:", Color::white() }
{ { 1 * 8, 12 * 8 }, "Save as:", Color::white() }
};
Button button_save_name {
{ 2 * 8, 17 * 8, 14 * 8, 48 },
{ 1 * 8, 17 * 8, 12 * 8, 48 },
"Name (set)"
};
Button button_save_timestamp {
{ 2 * 8, 25 * 8, 14 * 8, 48 },
{ 1 * 8, 25 * 8, 12 * 8, 48 },
"Timestamp:"
};
LiveDateTime live_timestamp {
{ 17 * 8, 27 * 8, 11 * 8, 16 }
{ 14 * 8, 27 * 8, 16 * 8, 16 }
};
};
@@ -126,7 +126,7 @@ public:
FrequencyLoadView(NavigationView& nav);
std::string title() const override { return "Load frequency"; };
std::string title() const override { return "Load freq."; };
private:
void refresh_widgets(const bool v);
@@ -137,7 +137,7 @@ public:
FrequencyManagerView(NavigationView& nav);
~FrequencyManagerView();
std::string title() const override { return "Freq. manager"; };
std::string title() const override { return "Freqman"; };
private:
std::string desc_buffer { };
+70 -4
View File
@@ -25,6 +25,7 @@
#include "ui_freqman.hpp"
#include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp"
using namespace portapack;
@@ -183,7 +184,8 @@ void JammerView::focus() {
JammerView::~JammerView() {
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void JammerView::on_retune(const rf::Frequency freq, const uint32_t range) {
@@ -268,12 +270,13 @@ void JammerView::start_tx() {
button_transmit.set_text("STOP");
transmitter_model.set_sampling_rate(3072000U);
transmitter_model.set_rf_amp(true);
transmitter_model.set_rf_amp(field_amp.value());
transmitter_model.set_baseband_bandwidth(3500000U);
transmitter_model.set_tx_gain(47);
transmitter_model.set_tx_gain(field_gain.value());
transmitter_model.enable();
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
mscounter = 0; //euquiq: Reset internal ms counter for do_timer()
} else {
if (out_of_ranges)
nav_.display_modal("Error", "Jamming bandwidth too large.\nMust be less than 24MHz.");
@@ -289,6 +292,59 @@ void JammerView::stop_tx() {
radio::disable();
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
jamming = false;
cooling = false;
}
//called each 1/60th of second
void JammerView::on_timer() {
if (++mscounter == 60) {
mscounter = 0;
if (jamming)
{
if (cooling)
{
if (++seconds >= field_timepause.value())
{ //Re-start TX
transmitter_model.enable();
button_transmit.set_text("STOP");
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
int32_t jitter_amount = field_jitter.value();
if (jitter_amount)
{
lfsr_v = lfsr_iterate(lfsr_v);
jitter_amount = (jitter_amount / 2) - (lfsr_v & jitter_amount);
mscounter += jitter_amount;
}
cooling = false;
seconds = 0;
}
}
else
{
if (++seconds >= field_timetx.value()) //Start cooling period:
{
transmitter_model.disable();
button_transmit.set_text("PAUSED");
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
int32_t jitter_amount = field_jitter.value();
if (jitter_amount)
{
lfsr_v = lfsr_iterate(lfsr_v);
jitter_amount = (jitter_amount / 2) - (lfsr_v & jitter_amount);
mscounter += jitter_amount;
}
cooling = true;
seconds = 0;
}
}
}
}
}
JammerView::JammerView(
@@ -309,6 +365,11 @@ JammerView::JammerView(
&text_range_total,
&options_speed,
&options_hop,
&field_timetx,
&field_timepause,
&field_jitter,
&field_gain,
&field_amp,
&button_transmit
});
@@ -321,8 +382,13 @@ JammerView::JammerView(
options_hop.set_selected_index(1); // 50ms
button_transmit.set_style(&style_val);
field_timetx.set_value(30);
field_timepause.set_value(1);
field_gain.set_value(transmitter_model.tx_gain());
field_amp.set_value(transmitter_model.rf_amp());
button_transmit.on_select = [this](Button&) {
if (jamming)
if (jamming || cooling)
stop_tx();
else
start_tx();
+80 -85
View File
@@ -28,6 +28,7 @@
#include "transmitter_model.hpp"
#include "message.hpp"
#include "jammer.hpp"
#include "lfsr_random.hpp"
using namespace jammer;
@@ -57,78 +58,11 @@ private:
.foreground = Color::grey(),
};
/*static constexpr jammer_range_t range_presets[] = {
// GSM900 Orange
{ true, 935000000, 945000000 }, // BW:10M
// GSM1800 Orange
{ true, 1808000000, 1832000000 }, // BW:24M
// GSM900 SFR
{ true, 950000000, 960000000 }, // BW:10M
// GSM1800 SFR
{ true, 1832000000, 1853000000 }, // BW:21M
// GSM900 Bouygues
{ true, 925000000, 935000000 }, // BW:10M
// GSM1800 Bouygues
{ true, 1858000000, 1880000000 }, // BW:22M
// GSM900 Free
{ true, 945000000, 950000000 }, // BW:5M
// GSM-R
{ true, 921000000, 925000000 }, // BW:4M
// DECT
{ true, 1880000000, 1900000000 }, // BW: 20MHz
// PMV AFSK
{ true, 162930000, 162970000 }, // BW: 40kHz
// ISM 433
{ true, 433050000, 434790000 }, // Center: 433.92MHz BW: 0.2%
// ISM 868
{ true, 868000000, 868200000 }, // Center: 868.2MHz BW: 40kHz
// GPS L1
{ true, 1575420000 - 500000, 1575420000 + 500000 }, // BW: 1MHz
// GPS L2
{ true, 1227600000 - 1000000, 1227600000 + 1000000 }, // BW: 2MHz
// WLAN 2.4G CH1
{ true, 2412000000 - 11000000, 2412000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH2
{ true, 2417000000 - 11000000, 2417000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH3
{ true, 2422000000 - 11000000, 2422000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH4
{ true, 2427000000 - 11000000, 2427000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH5
{ true, 2432000000 - 11000000, 2432000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH6
{ true, 2437000000 - 11000000, 2437000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH7
{ true, 2442000000 - 11000000, 2442000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH8
{ true, 2447000000 - 11000000, 2447000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH9
{ true, 2452000000 - 11000000, 2452000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH10
{ true, 2457000000 - 11000000, 2457000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH11
{ true, 2462000000 - 11000000, 2462000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH12
{ true, 2467000000 - 11000000, 2467000000 + 11000000}, // BW: 22MHz
// WLAN 2.4G CH13
{ true, 2472000000 - 11000000, 2472000000 + 11000000}, // BW: 22MHz
};*/
Labels labels {
{ { 2 * 8, 9 * 8 + 4 }, "Start", Color::light_grey() },
{ { 23 * 8, 9 * 8 + 4 }, "Stop", Color::light_grey() },
{ { 12 * 8, 6 * 8 }, "Center", Color::light_grey() },
{ { 12 * 8 + 4, 14 * 8 }, "Width", Color::light_grey() }
{ { 2 * 8, 8 * 8 + 4 }, "Start", Color::light_grey() },
{ { 23 * 8, 8 * 8 + 4 }, "Stop", Color::light_grey() },
{ { 12 * 8, 5 * 8 - 4}, "Center", Color::light_grey() },
{ { 12 * 8 + 4, 13 * 8 }, "Width", Color::light_grey() }
};
Checkbox check_enabled {
@@ -143,19 +77,19 @@ private:
};
Button button_start {
{ 0 * 8, 6 * 16, 11 * 8, 28 },
{ 0 * 8, 11 * 8, 11 * 8, 28 },
""
};
Button button_stop {
{ 19 * 8, 6 * 16, 11 * 8, 28 },
{ 19 * 8, 11 * 8, 11 * 8, 28 },
""
};
Button button_center {
{ 76, 4 * 16, 11 * 8, 28 },
{ 76, 4 * 15 - 4, 11 * 8, 28 },
""
};
Button button_width {
{ 76, 8 * 16, 11 * 8, 28 },
{ 76, 8 * 15, 11 * 8, 28 },
""
};
};
@@ -172,18 +106,23 @@ public:
void focus() override;
std::string title() const override { return "Jammer"; };
std::string title() const override { return "Jammer TX"; };
private:
NavigationView& nav_;
void start_tx();
void on_timer();
void stop_tx();
void set_jammer_channel(uint32_t i, uint32_t width, uint64_t center, uint32_t duration);
void on_retune(const rf::Frequency freq, const uint32_t range);
JammerChannel * jammer_channels = (JammerChannel*)shared_memory.bb_data.data;
bool jamming { false };
bool cooling { false }; //euquiq: Indicates jammer in cooldown
uint16_t seconds = 0; //euquiq: seconds counter for toggling tx / cooldown
int16_t mscounter = 0; //euquiq: Internal ms counter for do_timer()
lfsr_word_t lfsr_v = 1; //euquiq: Used to generate "random" Jitter
static constexpr Style style_val {
.font = font::fixed_8x16,
@@ -209,13 +148,21 @@ private:
};
Labels labels {
{ { 3 * 8, 12 * 16 }, "Type:", Color::light_grey() },
{ { 2 * 8, 13 * 16 }, "Speed:", Color::light_grey() },
{ { 5 * 8, 14 * 16 }, "Hop:", Color::light_grey() }
{ { 2 * 8, 23 * 8 }, "Type:", Color::light_grey() },
{ { 1 * 8, 25 * 8 }, "Speed:", Color::light_grey() },
{ { 3 * 8, 27 * 8 }, "Hop:", Color::light_grey() },
{ { 4 * 8, 29 * 8 }, "TX:", Color::light_grey() },
{ { 1 * 8, 31 * 8 }, "Sle3p:", Color::light_grey() }, //euquiq: Token of appreciation to TheSle3p, which made this ehnancement a reality with his bounty.
{ { 0 * 8, 33 * 8 }, "Jitter:", Color::light_grey() }, //Maybe the repository curator can keep the "mystype" for some versions.
{ { 11 * 8, 29 * 8 }, "Secs.", Color::light_grey() },
{ { 11 * 8, 31 * 8 }, "Secs.", Color::light_grey() },
{ { 11 * 8, 33 * 8 }, "/60", Color::light_grey() },
{ { 2 * 8, 35 * 8 }, "Gain:", Color::light_grey() },
{ { 11 * 8, 35 * 8 }, "A:", Color::light_grey() }
};
OptionsField options_type {
{ 9 * 8, 12 * 16 },
{ 7 * 8, 23 * 8 },
8,
{
{ "Rand FSK", 0 },
@@ -226,16 +173,16 @@ private:
};
Text text_range_number {
{ 22 * 8, 12 * 16, 2 * 8, 16 },
{ 16 * 8, 23 * 8, 2 * 8, 16 },
"--"
};
Text text_range_total {
{ 24 * 8, 12 * 16, 3 * 8, 16 },
{ 18 * 8, 23 * 8, 3 * 8, 16 },
"/--"
};
OptionsField options_speed {
{ 9 * 8, 13 * 16 },
{ 7 * 8, 25 * 8 },
6,
{
{ "10Hz ", 10 },
@@ -247,7 +194,7 @@ private:
};
OptionsField options_hop {
{ 9 * 8, 14 * 16 },
{ 7 * 8, 27 * 8 },
5,
{
{ "10ms ", 1 },
@@ -259,9 +206,49 @@ private:
{ "10s ", 1000 }
}
};
NumberField field_timetx {
{ 7 * 8, 29 * 8 },
3,
{ 1, 180 },
1,
' ',
};
NumberField field_timepause {
{ 8 * 8, 31 * 8 },
2,
{ 1, 60 },
1,
' ',
};
NumberField field_jitter {
{ 8 * 8, 33 * 8 },
2,
{ 1, 60 },
1,
' ',
};
NumberField field_gain {
{ 8 * 8, 35 * 8 },
2,
{ 0, 47 },
1,
' ',
};
NumberField field_amp {
{ 13 * 8, 35 * 8 },
1,
{ 0, 1 },
1,
' ',
};
Button button_transmit {
{ 9 * 8, 16 * 16, 96, 48 },
{ 148, 216, 80, 80},
"START"
};
@@ -272,6 +259,14 @@ private:
this->on_retune(message->freq, message->range);
}
};
MessageHandlerRegistration message_handler_frame_sync {
Message::ID::DisplayFrameSync,
[this](const Message* const) {
this->on_timer();
}
};
};
} /* namespace ui */
+13 -1
View File
@@ -23,6 +23,7 @@
#include "ui_keyfob.hpp"
#include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp"
using namespace portapack;
@@ -136,8 +137,12 @@ void KeyfobView::focus() {
}
KeyfobView::~KeyfobView() {
// save app settings
settings.save("tx_keyfob", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void KeyfobView::update_progress(const uint32_t progress) {
@@ -214,6 +219,13 @@ KeyfobView::KeyfobView(
&tx_view
});
// load app settings
auto rc = settings.load("tx_keyfob", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
frame[0] = 0x55;
update_symfields();
+6 -1
View File
@@ -23,6 +23,7 @@
#include "ui.hpp"
#include "ui_transmitter.hpp"
#include "transmitter_model.hpp"
#include "app_settings.hpp"
#include "encoders.hpp"
using namespace encoders;
@@ -36,11 +37,15 @@ public:
void focus() override;
std::string title() const override { return "Keyfob (BETA)"; };
std::string title() const override { return "Key fob TX"; };
private:
NavigationView& nav_;
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
// 1013210ns / bit
static constexpr uint32_t subaru_samples_per_bit = (OOK_SAMPLERATE * 0.00101321);
static constexpr uint32_t repeats = 4;
+16 -1
View File
@@ -27,6 +27,7 @@
#include "modems.hpp"
#include "baseband_api.hpp"
#include "string_format.hpp"
#include "cpld_update.hpp"
#include "serializer.hpp"
@@ -39,8 +40,13 @@ void LCRView::focus() {
}
LCRView::~LCRView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_lcr", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
/*
@@ -173,6 +179,15 @@ LCRView::LCRView(NavigationView& nav) {
&tx_view
});
// load app settings
auto rc = settings.load("tx_lcr", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
options_scanlist.set_selected_index(0);
const auto button_set_am_fn = [this, &nav](Button& button) {
+6 -1
View File
@@ -27,6 +27,7 @@
#include "message.hpp"
#include "transmitter_model.hpp"
#include "app_settings.hpp"
namespace ui {
@@ -39,7 +40,7 @@ public:
void focus() override;
std::string title() const override { return "LCR transmit"; };
std::string title() const override { return "TEDI/LCR TX"; };
private:
struct scan_list_t {
@@ -81,6 +82,10 @@ private:
SCAN
};
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
tx_modes tx_mode = IDLE;
uint8_t scan_count { 0 }, scan_index { 0 };
uint32_t scan_progress { 0 };
+308
View File
@@ -0,0 +1,308 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2018 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_level.hpp"
#include "ui_fileman.hpp"
#include "file.hpp"
using namespace portapack;
using portapack::memory::map::backup_ram;
namespace ui {
bool LevelView::check_sd_card()
{
return (sd_card::status() == sd_card::Status::Mounted) ? true : false;
}
void LevelView::focus() {
button_frequency.focus();
}
LevelView::~LevelView() {
// save app settings
app_settings.lna = field_lna.value();
app_settings.vga = field_vga.value();
app_settings.rx_amp = field_rf_amp.value();
settings.save("level", &app_settings);
receiver_model.disable();
baseband::shutdown();
}
LevelView::LevelView( NavigationView& nav) : nav_ { nav } {
add_children( {
&labels,
&field_lna,
&field_vga,
&field_rf_amp,
&field_volume,
&field_bw,
&field_mode,
&step_mode,
&rssi_resolution,
&button_frequency,
&text_ctcss,
&freq_stats_rssi,
&freq_stats_db,
&audio_mode,
&peak_mode,
&rssi,
&rssi_graph
} );
rssi.set_vertical_rssi( true );
field_volume.on_change = [this](int32_t v) { this->on_headphone_volume_changed(v); };
field_volume.set_value((receiver_model.headphone_volume() - audio::headphone::volume_range().max).decibel() + 99);
// Level directory
if( check_sd_card() ) { // Check to see if SD Card is mounted
make_new_directory( u"/LEVEL" );
sd_card_mounted = true ;
}
change_mode(NFM_MODULATION); //Start on AM
field_mode.set_by_value(NFM_MODULATION); //Reflect the mode into the manual selector
//HELPER: Pre-setting a manual range, based on stored frequency
freq = persistent_memory::tuned_frequency();
receiver_model.set_tuning_frequency( freq );
button_frequency.set_text( "<" + to_string_short_freq( freq ) + " MHz>" );
// load auto common app settings
if( sd_card_mounted )
{
auto rc = settings.load("level", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
receiver_model.set_rf_amp(app_settings.rx_amp);
}
}
button_frequency.on_select = [this, &nav](ButtonWithEncoder& button) {
auto new_view = nav_.push<FrequencyKeypadView>(freq);
new_view->on_changed = [this, &button](rf::Frequency f) {
freq = f ;
receiver_model.set_tuning_frequency( f ); // Retune to actual freq
button_frequency.set_text( "<" + to_string_short_freq( freq ) + " MHz>" );
};
};
button_frequency.on_change = [this]() {
int64_t def_step = freqman_entry_get_step_value( step_mode.selected_index() );
freq = freq + ( button_frequency.get_encoder_delta() * def_step );
if( freq < 1 )
{
freq = 1 ;
}
if( freq > ( MAX_UFREQ - def_step ) )
{
freq = MAX_UFREQ ;
}
button_frequency.set_encoder_delta( 0 );
receiver_model.set_tuning_frequency( freq ); // Retune to actual freq
button_frequency.set_text( "<" + to_string_short_freq( freq ) + " MHz>" );
};
field_mode.on_change = [this](size_t, OptionsField::value_t v) {
if( v != -1 )
{
receiver_model.disable();
baseband::shutdown();
change_mode(v);
if( audio_mode.selected_index() != 0 )
{
audio::output::start();
}
receiver_model.enable();
}
};
rssi_resolution.on_change = [this](size_t, OptionsField::value_t v) {
if( v != -1 )
{
rssi_graph.set_nb_columns( v );
}
};
audio_mode.on_change = [this](size_t, OptionsField::value_t v) {
if( v == 0 )
{
audio::output::stop();
}
else if( v == 1 )
{
audio::output::start();
this->on_headphone_volume_changed( (receiver_model.headphone_volume() - audio::headphone::volume_range().max).decibel() + 99 );
}
else
{
}
};
peak_mode.on_change = [this](size_t, OptionsField::value_t v) {
if( v == 0 )
{
rssi.set_peak( false , 0 );
}
else
{
rssi.set_peak( true , v );
}
};
// default peak value
peak_mode.set_selected_index(2);
rssi_resolution.set_selected_index(1);
//FILL STEP OPTIONS
freqman_set_modulation_option( field_mode );
freqman_set_step_option_short( step_mode );
freq_stats_rssi.set_style(&style_white);
freq_stats_db.set_style(&style_white);
}
void LevelView::on_headphone_volume_changed(int32_t v) {
const auto new_volume = volume_t::decibel(v - 99) + audio::headphone::volume_range().max;
receiver_model.set_headphone_volume(new_volume);
}
void LevelView::on_statistics_update(const ChannelStatistics& statistics) {
static int last_max_db = -1000 ;
static int last_min_rssi = -1000 ;
static int last_avg_rssi = -1000 ;
static int last_max_rssi = -1000 ;
rssi_graph.add_values( rssi.get_min() , rssi.get_avg() , rssi.get_max() , statistics.max_db );
bool refresh_db = false ;
bool refresh_rssi = false ;
if( last_max_db != statistics.max_db )
{
refresh_db = true ;
}
if( last_min_rssi != rssi.get_min() || last_avg_rssi != rssi.get_avg() || last_max_rssi != rssi.get_max() )
{
refresh_rssi = true ;
}
if( refresh_db )
{
last_max_db = statistics.max_db ;
freq_stats_db.set( "Power: "+to_string_dec_int( statistics.max_db )+" db" );
}
if( refresh_rssi )
{
last_min_rssi = rssi.get_min();
last_avg_rssi = rssi.get_avg();
last_max_rssi = rssi.get_max();
freq_stats_rssi.set( "RSSI: "+to_string_dec_int( rssi.get_min() )+"/"+to_string_dec_int( rssi.get_avg() )+"/"+to_string_dec_int( rssi.get_max() )+",dt: "+to_string_dec_int( rssi.get_delta() ) );
}
} /* on_statistic_updates */
size_t LevelView::change_mode( freqman_index_t new_mod ) {
field_bw.on_change = [this](size_t n, OptionsField::value_t) { (void)n; };
switch( new_mod ) {
case AM_MODULATION:
freqman_set_bandwidth_option( new_mod , field_bw );
//bw DSB (0) default
field_bw.set_selected_index(0);
baseband::run_image(portapack::spi_flash::image_tag_am_audio);
receiver_model.set_modulation(ReceiverModel::Mode::AMAudio);
receiver_model.set_am_configuration(field_bw.selected_index());
field_bw.on_change = [this](size_t n, OptionsField::value_t) { receiver_model.set_am_configuration(n); };
receiver_model.set_sampling_rate(3072000); receiver_model.set_baseband_bandwidth(1750000);
text_ctcss.set(" ");
break;
case NFM_MODULATION:
freqman_set_bandwidth_option( new_mod , field_bw );
//bw 16k (2) default
field_bw.set_selected_index(2);
baseband::run_image(portapack::spi_flash::image_tag_nfm_audio);
receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio);
receiver_model.set_nbfm_configuration(field_bw.selected_index());
field_bw.on_change = [this](size_t n, OptionsField::value_t) { receiver_model.set_nbfm_configuration(n); };
receiver_model.set_sampling_rate(3072000); receiver_model.set_baseband_bandwidth(1750000);
break;
case WFM_MODULATION:
freqman_set_bandwidth_option( new_mod , field_bw );
//bw 200k (0) only/default
field_bw.set_selected_index(0);
baseband::run_image(portapack::spi_flash::image_tag_wfm_audio);
receiver_model.set_modulation(ReceiverModel::Mode::WidebandFMAudio);
receiver_model.set_wfm_configuration(field_bw.selected_index());
field_bw.on_change = [this](size_t n, OptionsField::value_t) { receiver_model.set_wfm_configuration(n); };
receiver_model.set_sampling_rate(3072000); receiver_model.set_baseband_bandwidth(1750000);
text_ctcss.set(" ");
break;
default:
break;
}
return step_mode.selected_index();
}
void LevelView::handle_coded_squelch(const uint32_t value) {
static int32_t last_idx = -1 ;
float diff, min_diff = value;
size_t min_idx { 0 };
size_t c;
if( field_mode.selected_index() != NFM_MODULATION )
{
text_ctcss.set(" ");
return ;
}
// Find nearest match
for (c = 0; c < tone_keys.size(); c++) {
diff = abs(((float)value / 100.0) - tone_keys[c].second);
if (diff < min_diff) {
min_idx = c;
min_diff = diff;
}
}
// Arbitrary confidence threshold
if( last_idx < 0 || (unsigned)last_idx != min_idx )
{
last_idx = min_idx ;
if (min_diff < 40)
text_ctcss.set("T: "+tone_keys[min_idx].first);
else
text_ctcss.set(" ");
}
}
} /* namespace ui */
+236
View File
@@ -0,0 +1,236 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2018 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef _UI_LEVEL
#define _UI_LEVEL
#include "ui.hpp"
#include "receiver_model.hpp"
#include "ui_receiver.hpp"
#include "ui_font_fixed_8x16.hpp"
#include "freqman.hpp"
#include "analog_audio_app.hpp"
#include "audio.hpp"
#include "ui_mictx.hpp"
#include "portapack_persistent_memory.hpp"
#include "baseband_api.hpp"
#include "ui_spectrum.hpp"
#include "string_format.hpp"
#include "file.hpp"
#include "app_settings.hpp"
namespace ui {
class LevelView : public View {
public:
LevelView(NavigationView& nav);
~LevelView();
void focus() override;
const Style style_grey { // level
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::grey(),
};
const Style style_white { // level
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::white(),
};
const Style style_yellow { //Found signal
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::yellow(),
};
const Style style_green { //Found signal
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::green(),
};
const Style style_red { //erasing freq
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::red(),
};
const Style style_blue { // quick level, wait == 0
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::blue(),
};
std::string title() const override { return "Level"; };
private:
NavigationView& nav_;
size_t change_mode( freqman_index_t mod_type);
void on_statistics_update(const ChannelStatistics& statistics);
void set_display_freq( int64_t freq );
bool check_sd_card();
int32_t db { 0 };
long long int MAX_UFREQ = { 7200000000 }; // maximum usable freq
bool sd_card_mounted = false ;
rf::Frequency freq = { 0 } ;
Labels labels
{
{ { 0 * 8 , 0 * 16 }, "LNA: VGA: AMP: VOL: ", Color::light_grey() },
{ { 0 * 8 , 1 * 16 }, "BW: MODE: S: ", Color::light_grey() },
};
LNAGainField field_lna {
{ 4 * 8, 0 * 16 }
};
VGAGainField field_vga {
{ 11 * 8, 0 * 16 }
};
RFAmpField field_rf_amp {
{ 18 * 8, 0 * 16 }
};
NumberField field_volume {
{ 24 * 8, 0 * 16 },
2,
{ 0, 99 },
1,
' ',
};
OptionsField field_bw {
{ 3 * 8, 1 * 16 },
6,
{ }
};
OptionsField field_mode {
{ 15 * 8, 1 * 16 },
3,
{
}
};
OptionsField step_mode {
{ 16 * 8, 2 * 16 + 4 },
12,
{
}
};
ButtonWithEncoder button_frequency {
{ 0 * 8 , 2 * 16 + 8 , 15 * 8 , 1 * 8 },
""
};
OptionsField audio_mode {
{ 21 * 8, 1 * 16 },
9,
{
{"audio off", 0},
{"audio on",1}
//{"tone on", 2},
//{"tone off", 2},
}
};
Text text_ctcss {
{ 22 * 8, 3 * 16 + 4 , 14 * 8, 1 * 8 },
""
};
// RSSI: XX/XX/XXX,dt: XX
Text freq_stats_rssi {
{ 0 * 8 , 3 * 16 + 4 , 22 * 8, 14 },
};
// Power: -XXX db
Text freq_stats_db {
{ 0 * 8 , 4 * 16 + 4 , 14 * 8, 14 },
};
OptionsField peak_mode {
{ 40 + 10 * 8, 4 * 16 + 4 },
10,
{
{"peak:none", 0},
{"peak:0.25s",250},
{"peak:0.5s",500},
{"peak:1s",1000},
{"peak:3s",3000},
{"peak:5s",5000},
{"peak:10s",10000},
}
};
OptionsField rssi_resolution {
{ 44 + 20 * 8, 4 * 16 + 4},
4,
{
{"16x", 16},
{"32x", 32},
{"64x", 64},
{"128x", 128},
{"240x", 240},
}
};
RSSIGraph rssi_graph { // 240x320 =>
{ 0 , 5 * 16 + 4 , 240 - 5 * 8 , 320 - ( 5 * 16 + 4 ) },
};
RSSI rssi { // 240x320 =>
{ 240 - 5 * 8 , 5 * 16 + 4 , 5 * 8 , 320 - ( 5 * 16 + 4 ) },
};
void handle_coded_squelch(const uint32_t value);
void on_headphone_volume_changed(int32_t v);
MessageHandlerRegistration message_handler_coded_squelch {
Message::ID::CodedSquelch,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const CodedSquelchMessage*>(p);
this->handle_coded_squelch(message.value);
}
};
MessageHandlerRegistration message_handler_stats {
Message::ID::ChannelStatistics,
[this](const Message* const p) {
this->on_statistics_update(static_cast<const ChannelStatisticsMessage*>(p)->statistics);
}
};
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
};
} /* namespace ui */
#endif
+639 -280
View File
@@ -22,313 +22,672 @@
#include "ui_looking_glass_app.hpp"
using namespace portapack;
namespace ui
{
void GlassView::focus() {
field_marker.focus();
}
GlassView::~GlassView() {
receiver_model.set_sampling_rate(3072000); // Just a hack to avoid hanging other apps
receiver_model.disable();
baseband::shutdown();
}
void GlassView::on_lna_changed(int32_t v_db) {
receiver_model.set_lna(v_db);
}
void GlassView::on_vga_changed(int32_t v_db) {
receiver_model.set_vga(v_db);
}
void GlassView::add_spectrum_pixel(Color color)
{
spectrum_row[pixel_index++] = color;
if (pixel_index == 240) //got an entire waterfall line
{
const auto draw_y = display.scroll(1); //Scroll 1 pixel down
display.draw_pixels( {{0, draw_y}, {240, 1}}, spectrum_row); //new line at top
pixel_index = 0; //Start New cascade line
}
}
//Apparently, the spectrum object returns an array of 256 bins
//Each having the radio signal power for it's corresponding frequency slot
void GlassView::on_channel_spectrum(const ChannelSpectrum &spectrum)
{
baseband::spectrum_streaming_stop();
// Convert bins of this spectrum slice into a representative max_power and when enough, into pixels
// Spectrum.db has 256 bins. Center 12 bins are ignored (DC spike is blanked) Leftmost and rightmost 2 bins are ignored
// All things said and done, we actually need 240 of those bins:
for(uint8_t bin = 0; bin < 240; bin++)
void GlassView::focus()
{
if (bin < 120) {
if (spectrum.db[134 + bin] > max_power)
max_power = spectrum.db[134 + bin];
}
else
button_marker.focus();
}
GlassView::~GlassView()
{
receiver_model.set_sampling_rate(3072000); // Just a hack to avoid hanging other apps
receiver_model.disable();
baseband::shutdown();
}
// Returns the next multiple of num that is a multiple of multiplier
int64_t GlassView::next_mult_of(int64_t num, int64_t multiplier) {
return ((num / multiplier) + 1) * multiplier;
}
void GlassView::adjust_range(int64_t* f_min, int64_t* f_max, int64_t width) {
int64_t span = *f_max - *f_min;
int64_t num_intervals = span / width;
if( span % width != 0 )
{
if (spectrum.db[bin - 118] > max_power)
max_power = spectrum.db[bin - 118];
num_intervals++;
}
int64_t new_span = num_intervals * width;
int64_t delta_span = (new_span - span) / 2;
*f_min -= delta_span;
*f_max += delta_span;
}
bins_Hz_size += each_bin_size; //add this bin Hz count into the "pixel fulfilled bag of Hz"
void GlassView::on_lna_changed(int32_t v_db)
{
receiver_model.set_lna(v_db);
}
if (bins_Hz_size >= marker_pixel_step) //new pixel fullfilled
void GlassView::on_vga_changed(int32_t v_db)
{
receiver_model.set_vga(v_db);
}
void GlassView::reset_live_view( bool clear_screen )
{
max_freq_hold = 0 ;
max_freq_power = -1000 ;
if( clear_screen )
{
if (min_color_power < max_power)
add_spectrum_pixel(spectrum_rgb3_lut[max_power]); //Pixel will represent max_power
else
add_spectrum_pixel(0); //Filtered out, show black
max_power = 0;
if (!pixel_index) //Received indication that a waterfall line has been completed
// only clear screen in peak mode
if( live_frequency_view == 2 )
{
bins_Hz_size = 0; //Since this is an entire pixel line, we don't carry "Pixels into next bin"
break;
} else {
bins_Hz_size -= marker_pixel_step; //reset bins size, but carrying the eventual excess Hz into next pixel
display.fill_rectangle( { { 0 , 108 + 16 } , { 240 , 320 - (108 + 16) } } , { 0 , 0 , 0 } );
}
}
}
if (pixel_index)
f_center += SEARCH_SLICE_WIDTH; //Move into the next bandwidth slice NOTE: spectrum.sampling_rate = SEARCH_SLICE_WIDTH
else
f_center = f_center_ini; //Start a new sweep
void GlassView::add_spectrum_pixel( uint8_t power )
{
static int64_t last_max_freq = 0 ;
receiver_model.set_tuning_frequency(f_center); //tune rx for this slice
baseband::spectrum_streaming_start(); //Do the RX
}
spectrum_row[pixel_index] = spectrum_rgb3_lut[power] ; // row of colors
spectrum_data[pixel_index] = ( live_frequency_integrate * spectrum_data[pixel_index] + power ) / (live_frequency_integrate + 1); // smoothing
pixel_index ++ ;
void GlassView::on_hide()
{
baseband::spectrum_streaming_stop();
display.scroll_disable();
}
if (pixel_index == 240) // got an entire waterfall line
{
if( live_frequency_view > 0 )
{
constexpr int rssi_sample_range = 256;
constexpr float rssi_voltage_min = 0.4;
constexpr float rssi_voltage_max = 2.2;
constexpr float adc_voltage_max = 3.3;
constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max;
constexpr int raw_max = rssi_sample_range * rssi_voltage_max / adc_voltage_max;
constexpr int raw_delta = raw_max - raw_min;
const range_t<int> y_max_range { 0 , 320 - ( 108 + 16 ) };
void GlassView::on_show()
{
display.scroll_set_area( 109, 319); //Restart scroll on the correct coordinates
baseband::spectrum_streaming_start();
}
//drawing and keeping track of max freq
for( uint16_t xpos = 0 ; xpos < 240 ; xpos ++ )
{
// save max powerwull freq
if( spectrum_data[ xpos ] > max_freq_power )
{
max_freq_power = spectrum_data[ xpos ];
max_freq_hold = f_min + ( (f_max - f_min) * xpos) / 240 ;
}
void GlassView::on_range_changed()
{
f_min = field_frequency_min.value();
f_max = field_frequency_max.value();
search_span = f_max - f_min;
field_marker.set_range(f_min, f_max); //Move the marker between range
field_marker.set_value(f_min + (search_span / 2)); //Put MARKER AT MIDDLE RANGE
text_range.set(to_string_dec_uint(search_span));
f_min = (f_min)*MHZ_DIV; //Transpose into full frequency realm
f_max = (f_max)*MHZ_DIV;
search_span = search_span * MHZ_DIV;
marker_pixel_step = search_span / 240; //Each pixel value in Hz
text_marker_pm.set(to_string_dec_uint((marker_pixel_step / X2_MHZ_DIV) + 1)); // Give idea of +/- marker precision
int32_t marker_step = marker_pixel_step / MHZ_DIV;
if (!marker_step)
field_marker.set_step(1); //in case selected range is less than 240 (pixels)
else
field_marker.set_step(marker_step); //step needs to be a pixel wide.
f_center_ini = f_min + (SEARCH_SLICE_WIDTH / 2); //Initial center frequency for sweep
f_center_ini += SEARCH_SLICE_WIDTH; //euquiq: Why do I need to move the center ???!!! (shift needed for marker accuracy)
PlotMarker(field_marker.value()); //Refresh marker on screen
f_center = f_center_ini; //Reset sweep into first slice
pixel_index = 0; //reset pixel counter
max_power = 0;
bins_Hz_size = 0; //reset amount of Hz filled up by pixels
baseband::set_spectrum(SEARCH_SLICE_WIDTH, field_trigger.value());
receiver_model.set_tuning_frequency(f_center_ini); //tune rx for this slice
}
void GlassView::PlotMarker(rf::Frequency pos)
{
pos = pos * MHZ_DIV;
pos -= f_min;
pos = pos / marker_pixel_step; //Real pixel
portapack::display.fill_rectangle({0, 100, 240, 8}, Color::black()); //Clear old marker and whole marker rectangle btw
portapack::display.fill_rectangle({pos - 2, 100, 5, 3}, Color::red()); //Red marker middle
portapack::display.fill_rectangle({pos - 1, 103, 3, 3}, Color::red()); //Red marker middle
portapack::display.fill_rectangle({pos, 106, 1, 2}, Color::red()); //Red marker middle
}
GlassView::GlassView(
NavigationView &nav) : nav_(nav)
{
baseband::run_image(portapack::spi_flash::image_tag_wideband_spectrum);
add_children({&labels,
&field_frequency_min,
&field_frequency_max,
&field_lna,
&field_vga,
&text_range,
&filter_config,
&field_rf_amp,
&range_presets,
&field_marker,
&text_marker_pm,
&field_trigger
});
load_Presets(); //Load available presets from TXT files (or default)
field_frequency_min.set_value(presets_db[0].min); //Defaults to first preset
field_frequency_min.on_change = [this](int32_t v) {
if (v >= field_frequency_max.value())
field_frequency_max.set_value(v + 240);
this->on_range_changed();
};
field_frequency_max.set_value(presets_db[0].max); //Defaults to first preset
field_frequency_max.on_change = [this](int32_t v) {
if (v <= field_frequency_min.value())
field_frequency_min.set_value(v - 240);
this->on_range_changed();
};
field_lna.set_value(receiver_model.lna());
field_lna.on_change = [this](int32_t v) {
this->on_lna_changed(v);
};
field_vga.set_value(receiver_model.vga());
field_vga.on_change = [this](int32_t v_db) {
this->on_vga_changed(v_db);
};
filter_config.set_selected_index(0);
filter_config.on_change = [this](size_t n, OptionsField::value_t v) {
min_color_power = v;
};
range_presets.on_change = [this](size_t n, OptionsField::value_t v) {
field_frequency_min.set_value(presets_db[v].min,false);
field_frequency_max.set_value(presets_db[v].max,false);
this->on_range_changed();
};
field_marker.on_change = [this](int32_t v) {
PlotMarker(v); //Refresh marker on screen
};
field_marker.on_select = [this](NumberField&) {
f_center = field_marker.value();
f_center = f_center * MHZ_DIV;
receiver_model.set_tuning_frequency(f_center); //Center tune rx in marker freq.
receiver_model.set_frequency_step(MHZ_DIV); // Preset a 1 MHz frequency step into RX -> AUDIO
nav_.pop();
nav_.push<AnalogAudioView>(); //Jump into audio view
};
field_trigger.set_value(32); //Defaults to 32, as normal triggering resolution
field_trigger.on_change = [this](int32_t v) {
baseband::set_spectrum(SEARCH_SLICE_WIDTH, v);
};
display.scroll_set_area( 109, 319);
baseband::set_spectrum(SEARCH_SLICE_WIDTH, field_trigger.value()); //trigger:
// Discord User jteich: WidebandSpectrum::on_message to set the trigger value. In WidebandSpectrum::execute ,
// it keeps adding the output of the fft to the buffer until "trigger" number of calls are made,
//at which time it pushes the buffer up with channel_spectrum.feed
on_range_changed();
receiver_model.set_modulation(ReceiverModel::Mode::SpectrumAnalysis);
receiver_model.set_sampling_rate(SEARCH_SLICE_WIDTH); //20mhz
receiver_model.set_baseband_bandwidth(SEARCH_SLICE_WIDTH); // possible values: 1.75/2.5/3.5/5/5.5/6/7/8/9/10/12/14/15/20/24/28MHz
receiver_model.set_squelch_level(0);
receiver_model.enable();
}
void GlassView::load_Presets() {
File presets_file; //LOAD /WHIPCALC/ANTENNAS.TXT from microSD
auto result = presets_file.open("LOOKINGGLASS/PRESETS.TXT");
presets_db.clear(); //Start with fresh db
if (result.is_valid()) {
presets_Default(); //There is no txt, store a default range
} else {
std::string line; //There is a txt file
char one_char[1]; //Read it char by char
for (size_t pointer=0; pointer < presets_file.size();pointer++) {
presets_file.seek(pointer);
presets_file.read(one_char, 1);
if ((int)one_char[0] > 31) { //ascii space upwards
line += one_char[0]; //Add it to the textline
}
else if (one_char[0] == '\n') { //New Line
txtline_process(line); //make sense of this textline
line.clear(); //Ready for next textline
}
}
if (line.length() > 0) txtline_process(line); //Last line had no newline at end ?
if (!presets_db.size()) presets_Default(); //no antenna on txt, use default
int16_t point = y_max_range.clip( ( ( spectrum_data[ xpos ] - raw_min ) * ( 320 - ( 108 + 16 ) ) ) / raw_delta );
uint8_t color_gradient = (point * 255) / 212 ;
// clear if not in peak view
if( live_frequency_view != 2 )
{
display.fill_rectangle( { { xpos , 108 + 16 } , { 1 , 320 - point } } , { 0 , 0 , 0 } );
}
display.fill_rectangle( { { xpos , 320 - point } , { 1 , point } } , { color_gradient , 0 , uint8_t( 255 - color_gradient ) } );
}
if( last_max_freq != max_freq_hold )
{
last_max_freq = max_freq_hold ;
freq_stats.set( "MAX HOLD: "+to_string_short_freq( max_freq_hold ) );
}
PlotMarker( marker );
}
else
{
display.draw_pixels({{0, display.scroll(1)}, {240, 1}}, spectrum_row); // new line at top, one less var, speedier
}
pixel_index = 0; // Start New cascade line
}
}
populate_Presets();
}
// Apparently, the spectrum object returns an array of 256 bins
// Each having the radio signal power for it's corresponding frequency slot
void GlassView::on_channel_spectrum(const ChannelSpectrum &spectrum)
{
// default fast scan offset
uint8_t offset = 2 ;
baseband::spectrum_streaming_stop();
if( fast_scan || ( LOOKING_GLASS_SLICE_WIDTH < LOOKING_GLASS_SLICE_WIDTH_MAX ) )
{
// Convert bins of this spectrum slice into a representative max_power and when enough, into pixels
// Spectrum.db has 256 bins.
// All things said and done, we actually need 240 of those bins
for (uint8_t bin = 0; bin < 240; bin++)
{
// if the view is done in one pass, show it like in analog_audio_app
if( ( LOOKING_GLASS_SLICE_WIDTH < LOOKING_GLASS_SLICE_WIDTH_MAX ) )
{
// Center 16 bins are ignored (DC spike is blanked)
if (bin < 120)
{
if (spectrum.db[256 - 120 + bin] > max_power) // 134
max_power = spectrum.db[256 - 120 + bin];
}
else
{
if (spectrum.db[ bin - 120] > max_power) // 118
max_power = spectrum.db[bin - 120];
}
}
else // view is made in multiple pass, use original bin picking
{
// Center 12 bins are ignored (DC spike is blanked) Leftmost and rightmost 2 bins are ignored
if (bin < 120)
{
if (spectrum.db[134 + bin] > max_power) // 134
max_power = spectrum.db[134 + bin];
}
else
{
if (spectrum.db[bin - 118] > max_power) // 118
max_power = spectrum.db[bin - 118];
}
}
if( bin == 120 )
{
bins_Hz_size += 12 * each_bin_size; // add DC bin Hz count into the "pixel fulfilled bag of Hz"
}
else
{
bins_Hz_size += each_bin_size; // add this bin Hz count into the "pixel fulfilled bag of Hz"
}
void GlassView::txtline_process(std::string& line)
{
if (line.find("#") != std::string::npos) return; //Line is just a comment
if (bins_Hz_size >= marker_pixel_step) // new pixel fullfilled
{
if (min_color_power < max_power)
add_spectrum_pixel(max_power); // Pixel will represent max_power
else
add_spectrum_pixel(0); // Filtered out, show black
size_t comma = line.find(","); //Get first comma position
if (comma == std::string::npos) return; //No comma at all
max_power = 0;
size_t previous = 0;
preset_entry new_preset;
new_preset.min = std::stoi(line.substr(0,comma));
if (!new_preset.min) return; //No frequency!
previous = comma + 1;
comma = line.find(",",previous); //Search for next delimiter
if (comma == std::string::npos) return; //No comma at all
new_preset.max = std::stoi(line.substr(previous,comma - previous));
if (!new_preset.max) return; //No frequency!
new_preset.label = line.substr(comma + 1);
if (new_preset.label.size() == 0) return; //No label ?
presets_db.push_back(new_preset); //Add this preset.
}
void GlassView::populate_Presets()
{
using option_t = std::pair<std::string, int32_t>;
using options_t = std::vector<option_t>;
options_t entries;
for (preset_entry preset : presets_db)
{ //go thru all available presets
entries.emplace_back(preset.label,entries.size());
if (!pixel_index) // Received indication that a waterfall line has been completed
{
bins_Hz_size = 0; // Since this is an entire pixel line, we don't carry "Pixels into next bin"
f_center = f_center_ini - offset * each_bin_size ; // Start a new sweep
radio::set_tuning_frequency(f_center); // tune rx for this new slice directly, faster than using persistent memory saving
chThdSleepMilliseconds(10);
baseband::spectrum_streaming_start(); // Do the RX
return;
}
bins_Hz_size -= marker_pixel_step; // reset bins size, but carrying the eventual excess Hz into next pixel
}
}
f_center += ( 256 - ( 2 * offset ) ) * each_bin_size ; // Move into the next bandwidth slice NOTE: spectrum.sampling_rate = LOOKING_GLASS_SLICE_WIDTH
// lost bins are taken in account so next slice first ignored bins overlap previous kept ones
}
range_presets.set_options(entries);
}
else //slow scan
{
offset = 32 ;
uint8_t bin_length = 80 ;
for (uint8_t bin = offset ; bin < bin_length + offset ; bin++)
{
if (bin < 120)
{
if (spectrum.db[134 + bin] > max_power) // 134
max_power = spectrum.db[134 + bin];
}
else
{
if (spectrum.db[bin - 118] > max_power) // 118
max_power = spectrum.db[bin - 118];
}
void GlassView::presets_Default()
{
bins_Hz_size += each_bin_size; // add this bin Hz count into the "pixel fulfilled bag of Hz"
if (bins_Hz_size >= marker_pixel_step) // new pixel fullfilled
{
if (min_color_power < max_power)
add_spectrum_pixel(max_power); // Pixel will represent max_power
else
add_spectrum_pixel(0); // Filtered out, show black
max_power = 0;
if (!pixel_index) // Received indication that a waterfall line has been completed
{
bins_Hz_size = 0; // Since this is an entire pixel line, we don't carry "Pixels into next bin"
f_center = f_center_ini - offset * each_bin_size ; // Start a new sweep
radio::set_tuning_frequency(f_center); // tune rx for this new slice directly, faster than using persistent memory saving
chThdSleepMilliseconds(10);
baseband::spectrum_streaming_start(); // Do the RX
return;
}
bins_Hz_size -= marker_pixel_step; // reset bins size, but carrying the eventual excess Hz into next pixel
}
}
f_center += bin_length * each_bin_size ;
}
radio::set_tuning_frequency(f_center); // tune rx for this new slice directly, faster than using persistent memory saving
chThdSleepMilliseconds(5);
baseband::spectrum_streaming_start(); // Do the RX
}
void GlassView::on_hide()
{
baseband::spectrum_streaming_stop();
display.scroll_disable();
}
void GlassView::on_show()
{
display.scroll_set_area(109, 319); // Restart scroll on the correct coordinates
baseband::spectrum_streaming_start();
}
void GlassView::on_range_changed()
{
reset_live_view( false );
f_min = field_frequency_min.value();
f_max = field_frequency_max.value();
search_span = f_max - f_min;
if( locked_range )
{
button_range.set_text(">"+to_string_dec_uint(search_span)+"<");
}
else
{
button_range.set_text(" "+to_string_dec_uint(search_span)+" ");
}
f_min = (f_min)*MHZ_DIV; // Transpose into full frequency realm
f_max = (f_max)*MHZ_DIV;
adjust_range( &f_min , &f_max , 240 );
marker_pixel_step = (f_max - f_min) / 240; // Each pixel value in Hz
marker = f_min + (f_max - f_min) / 2 ;
button_marker.set_text( to_string_short_freq( marker ) );
PlotMarker( marker ); // Refresh marker on screen
pixel_index = 0; // reset pixel counter
max_power = 0;
bins_Hz_size = 0; // reset amount of Hz filled up by pixels
if( (f_max - f_min) <= LOOKING_GLASS_SLICE_WIDTH_MAX )
{
LOOKING_GLASS_SLICE_WIDTH = (f_max - f_min) ;
receiver_model.set_sampling_rate(LOOKING_GLASS_SLICE_WIDTH);
receiver_model.set_baseband_bandwidth(LOOKING_GLASS_SLICE_WIDTH/2);
}
else if( LOOKING_GLASS_SLICE_WIDTH != LOOKING_GLASS_SLICE_WIDTH_MAX )
{
LOOKING_GLASS_SLICE_WIDTH = LOOKING_GLASS_SLICE_WIDTH_MAX ;
receiver_model.set_sampling_rate(LOOKING_GLASS_SLICE_WIDTH);
receiver_model.set_baseband_bandwidth(LOOKING_GLASS_SLICE_WIDTH);
}
if( next_mult_of( LOOKING_GLASS_SLICE_WIDTH , 256 ) > LOOKING_GLASS_SLICE_WIDTH_MAX )
LOOKING_GLASS_SLICE_WIDTH = LOOKING_GLASS_SLICE_WIDTH_MAX ;
else
LOOKING_GLASS_SLICE_WIDTH = next_mult_of( LOOKING_GLASS_SLICE_WIDTH , 256 );
receiver_model.set_squelch_level(0);
each_bin_size = LOOKING_GLASS_SLICE_WIDTH / 256 ;
f_center_ini = f_min + (LOOKING_GLASS_SLICE_WIDTH / 2) ; // Initial center frequency for sweep
f_center = f_center_ini ; // Reset sweep into first slice
baseband::set_spectrum(LOOKING_GLASS_SLICE_WIDTH, field_trigger.value());
receiver_model.set_tuning_frequency(f_center_ini); // tune rx for this slice
}
void GlassView::PlotMarker(rf::Frequency pos)
{
pos -= f_min;
pos = pos / marker_pixel_step; // Real pixel
uint8_t shift_y = 0 ;
if( live_frequency_view > 0 ) // plot one line down when in live view
{
shift_y = 16 ;
}
portapack::display.fill_rectangle({0, 100 + shift_y, 240, 8}, Color::black()); // Clear old marker and whole marker rectangle btw
portapack::display.fill_rectangle({(int)pos - 2, 100 + shift_y, 5, 3}, Color::red()); // Red marker top
portapack::display.fill_rectangle({(int)pos - 1, 103 + shift_y, 3, 3}, Color::red()); // Red marker middle
portapack::display.fill_rectangle({(int)pos, 106 + shift_y, 1, 2}, Color::red()); // Red marker bottom
}
GlassView::GlassView(
NavigationView &nav) : nav_(nav)
{
baseband::run_image(portapack::spi_flash::image_tag_wideband_spectrum);
add_children({&labels,
&field_frequency_min,
&field_frequency_max,
&field_lna,
&field_vga,
&button_range,
&steps_config,
&scan_type,
&view_config,
&level_integration,
&filter_config,
&field_rf_amp,
&range_presets,
&button_marker,
&field_trigger,
&button_jump,
&button_rst,
&freq_stats});
load_Presets(); // Load available presets from TXT files (or default)
field_frequency_min.on_change = [this](int32_t v)
{
reset_live_view( true );
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 2 )
min_size = 2 ;
if( v > 7200 - min_size )
{
v = 7200 - min_size ;
field_frequency_min.set_value( v );
}
if (v > (field_frequency_max.value() - min_size ) )
field_frequency_max.set_value( v + min_size );
if( locked_range )
field_frequency_max.set_value( v + min_size );
this->on_range_changed();
};
field_frequency_min.set_value(presets_db[0].min); // Defaults to first preset
field_frequency_min.set_step( steps );
field_frequency_min.on_select = [this, &nav](NumberField& field) {
auto new_view = nav_.push<FrequencyKeypadView>(field_frequency_min.value()*1000000);
new_view->on_changed = [this, &field](rf::Frequency f) {
int32_t freq = f / 1000000 ;
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 2 )
min_size = 2 ;
if( freq > (7200 - min_size ) )
freq = 7200 - min_size ;
field_frequency_min.set_value( freq );
if( field_frequency_max.value() < ( freq + min_size ) )
field_frequency_max.set_value( freq + min_size );
this->on_range_changed();
};
};
field_frequency_max.on_change = [this](int32_t v)
{
reset_live_view( true );
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 2 )
min_size = 2 ;
if( v < min_size )
{
v = min_size ;
field_frequency_max.set_value( v );
}
if (v < (field_frequency_min.value() + min_size) )
field_frequency_min.set_value(v - min_size);
if( locked_range )
field_frequency_min.set_value( v - min_size );
this->on_range_changed();
};
field_frequency_max.set_value(presets_db[0].max); // Defaults to first preset
field_frequency_max.set_step( steps );
field_frequency_max.on_select = [this, &nav](NumberField& field) {
auto new_view = nav_.push<FrequencyKeypadView>(field_frequency_max.value()*1000000);
new_view->on_changed = [this, &field](rf::Frequency f) {
int32_t min_size = steps ;
if( locked_range )
min_size = search_span ;
if( min_size < 2 )
min_size = 2 ;
int32_t freq = f / 1000000 ;
if( freq < min_size )
freq = min_size ;
field_frequency_max.set_value( freq );
if( field_frequency_min.value() > ( freq - min_size) )
field_frequency_min.set_value( freq - min_size );
this->on_range_changed();
};
};
field_lna.on_change = [this](int32_t v)
{
reset_live_view( true );
this->on_lna_changed(v);
};
field_lna.set_value(receiver_model.lna());
field_vga.on_change = [this](int32_t v_db)
{
reset_live_view( true );
this->on_vga_changed(v_db);
};
field_vga.set_value(receiver_model.vga());
steps_config.on_change = [this](size_t n, OptionsField::value_t v)
{
(void)n;
field_frequency_min.set_step( v );
field_frequency_max.set_step( v );
steps = v ;
};
steps_config.set_selected_index(0); //default of 1 Mhz steps
scan_type.on_change = [this](size_t n, OptionsField::value_t v)
{
(void)n;
fast_scan = v ;
};
scan_type.set_selected_index(0); // default legacy fast scan
view_config.on_change = [this](size_t n, OptionsField::value_t v)
{
(void)n;
// clear between changes
reset_live_view( true );
if( v == 0 )
{
live_frequency_view = 0 ;
level_integration.hidden( true );
freq_stats.hidden( true );
button_jump.hidden( true );
button_rst.hidden( true );
display.scroll_set_area(109, 319); // Restart scroll on the correct coordinates
}
else if( v == 1 )
{
display.fill_rectangle( { { 0 , 108 } , { 240 , 24 } } , { 0 , 0 , 0 } );
live_frequency_view = 1 ;
display.scroll_disable();
level_integration.hidden( false );
freq_stats.hidden( false );
button_jump.hidden( false );
button_rst.hidden( false );
}
else if( v == 2 )
{
display.fill_rectangle( { { 0 , 108 } , { 240 , 24 } } , { 0 , 0 , 0 } );
live_frequency_view = 2 ;
display.scroll_disable();
level_integration.hidden( false );
freq_stats.hidden( false );
button_jump.hidden( false );
button_rst.hidden( false );
}
set_dirty();
};
view_config.set_selected_index(0); //default spectrum
level_integration.on_change = [this](size_t n, OptionsField::value_t v)
{
(void)n;
reset_live_view( true );
live_frequency_integrate = v ;
};
level_integration.set_selected_index(3); //default integration of ( 3 * old value + new_value ) / 4
filter_config.on_change = [this](size_t n, OptionsField::value_t v) {
(void)n;
reset_live_view( true );
min_color_power = v;
};
filter_config.set_selected_index(0);
range_presets.on_change = [this](size_t n, OptionsField::value_t v)
{
(void)n;
field_frequency_min.set_value(presets_db[v].min, false);
field_frequency_max.set_value(presets_db[v].max, false);
this->on_range_changed();
};
button_marker.on_change = [this]()
{
marker = marker + button_marker.get_encoder_delta() * marker_pixel_step ;
if( marker < f_min )
marker = f_min ;
if( marker > f_max )
marker = f_max ;
button_marker.set_text( to_string_short_freq( marker ) );
button_marker.set_encoder_delta( 0 );
PlotMarker( marker ); // Refresh marker on screen
};
button_marker.on_select = [this](ButtonWithEncoder &)
{
receiver_model.set_tuning_frequency(marker); // Center tune rx in marker freq.
receiver_model.set_frequency_step(MHZ_DIV); // Preset a 1 MHz frequency step into RX -> AUDIO
nav_.pop();
nav_.push<AnalogAudioView>(); // Jump into audio view
};
field_trigger.on_change = [this](int32_t v)
{
baseband::set_spectrum(LOOKING_GLASS_SLICE_WIDTH, v);
};
field_trigger.set_value(32); // Defaults to 32, as normal triggering resolution
button_range.on_select = [this](Button&) {
if( locked_range )
{
locked_range = false ;
button_range.set_style(&style_white);
button_range.set_text(" "+to_string_dec_uint(search_span)+" ");
}
else
{
locked_range = true ;
button_range.set_style(&style_red);
button_range.set_text(">"+to_string_dec_uint(search_span)+"<");
}
};
button_jump.on_select = [this](Button&) {
receiver_model.set_tuning_frequency(max_freq_hold); // Center tune rx in marker freq.
receiver_model.set_frequency_step(MHZ_DIV); // Preset a 1 MHz frequency step into RX -> AUDIO
nav_.pop();
nav_.push<AnalogAudioView>(); // Jump into audio view
};
button_rst.on_select = [this](Button&) {
reset_live_view( true );
};
display.scroll_set_area(109, 319);
baseband::set_spectrum(LOOKING_GLASS_SLICE_WIDTH, field_trigger.value()); // trigger:
// Discord User jteich: WidebandSpectrum::on_message to set the trigger value. In WidebandSpectrum::execute ,
// it keeps adding the output of the fft to the buffer until "trigger" number of calls are made,
// at which time it pushes the buffer up with channel_spectrum.feed
on_range_changed();
receiver_model.set_modulation(ReceiverModel::Mode::SpectrumAnalysis);
receiver_model.set_sampling_rate(LOOKING_GLASS_SLICE_WIDTH); // 20mhz
receiver_model.set_baseband_bandwidth(LOOKING_GLASS_SLICE_WIDTH); // possible values: 1.75/2.5/3.5/5/5.5/6/7/8/9/10/12/14/15/20/24/28MHz
receiver_model.set_squelch_level(0);
receiver_model.enable();
}
void GlassView::load_Presets()
{
File presets_file; // LOAD /WHIPCALC/ANTENNAS.TXT from microSD
auto result = presets_file.open("LOOKINGGLASS/PRESETS.TXT");
presets_db.clear(); // Start with fresh db
if (result.is_valid())
{
presets_Default(); // There is no txt, store a default range
}
else
{
std::string line; // There is a txt file
char one_char[1]; // Read it char by char
for (size_t pointer = 0; pointer < presets_file.size(); pointer++)
{
presets_file.seek(pointer);
presets_file.read(one_char, 1);
if ((int)one_char[0] > 31)
{ // ascii space upwards
line += one_char[0]; // Add it to the textline
}
else if (one_char[0] == '\n')
{ // New Line
txtline_process(line); // make sense of this textline
line.clear(); // Ready for next textline
}
}
if (line.length() > 0)
txtline_process(line); // Last line had no newline at end ?
if (!presets_db.size())
presets_Default(); // no antenna on txt, use default
}
populate_Presets();
}
void GlassView::txtline_process(std::string &line)
{
if (line.find("#") != std::string::npos)
return; // Line is just a comment
size_t comma = line.find(","); // Get first comma position
if (comma == std::string::npos)
return; // No comma at all
size_t previous = 0;
preset_entry new_preset;
new_preset.min = std::stoi(line.substr(0, comma));
if (!new_preset.min)
return; // No frequency!
previous = comma + 1;
comma = line.find(",", previous); // Search for next delimiter
if (comma == std::string::npos)
return; // No comma at all
new_preset.max = std::stoi(line.substr(previous, comma - previous));
if (!new_preset.max)
return; // No frequency!
new_preset.label = line.substr(comma + 1);
if (new_preset.label.size() == 0)
return; // No label ?
presets_db.push_back(new_preset); // Add this preset.
}
void GlassView::populate_Presets()
{
using option_t = std::pair<std::string, int32_t>;
using options_t = std::vector<option_t>;
options_t entries;
for (preset_entry preset : presets_db)
{ // go thru all available presets
entries.emplace_back(preset.label, entries.size());
}
range_presets.set_options(entries);
}
void GlassView::presets_Default()
{
presets_db.clear();
presets_db.push_back({2320, 2560, "DEFAULT WIFI 2.4GHz"});
}
}
}
+259 -164
View File
@@ -1,183 +1,278 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2020 euquiq
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2020 euquiq
* Copyright (C) 2023 gullradriel, Nilorea Studio Inc.
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui.hpp"
#include "portapack.hpp"
#include "baseband_api.hpp"
#include "receiver_model.hpp"
#include "ui_widget.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "string_format.hpp"
#include "analog_audio_app.hpp"
#include "spectrum_color_lut.hpp"
#ifndef _UI_GLASS
#define _UI_GLASS
namespace ui
{
#define SEARCH_SLICE_WIDTH 20000000 // Each slice bandwidth 20 MHz
#define MHZ_DIV 1000000
#define X2_MHZ_DIV 2000000
#include "ui.hpp"
#include "portapack.hpp"
#include "baseband_api.hpp"
#include "receiver_model.hpp"
#include "ui_widget.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "string_format.hpp"
#include "analog_audio_app.hpp"
#include "spectrum_color_lut.hpp"
class GlassView : public View
{
public:
GlassView(NavigationView &nav);
~GlassView();
std::string title() const override { return "Looking Glass"; };
namespace ui
{
#define LOOKING_GLASS_SLICE_WIDTH_MAX 20000000
#define MHZ_DIV 1000000
#define X2_MHZ_DIV 2000000
void on_show() override;
void on_hide() override;
void focus() override;
class GlassView : public View
{
public:
GlassView(NavigationView &nav);
private:
NavigationView& nav_;
GlassView( const GlassView &);
GlassView& operator=(const GlassView &nav);
struct preset_entry
{
rf::Frequency min{};
rf::Frequency max{};
std::string label{};
};
~GlassView();
std::string title() const override { return "LookingGlass"; };
std::vector<preset_entry> presets_db{};
void on_show() override;
void on_hide() override;
void focus() override;
void on_channel_spectrum(const ChannelSpectrum& spectrum);
void do_timers();
void on_range_changed();
void on_lna_changed(int32_t v_db);
void on_vga_changed(int32_t v_db);
void add_spectrum_pixel(Color color);
void PlotMarker(rf::Frequency pos);
void load_Presets();
void txtline_process(std::string& line);
void populate_Presets();
void presets_Default();
private:
NavigationView& nav_;
rf::Frequency f_min { 0 }, f_max { 0 };
rf::Frequency search_span { 0 };
rf::Frequency f_center { 0 };
rf::Frequency f_center_ini { 0 };
rf::Frequency marker_pixel_step { 0 };
rf::Frequency each_bin_size { SEARCH_SLICE_WIDTH / 240 };
rf::Frequency bins_Hz_size { 0 };
uint8_t min_color_power { 0 };
uint32_t pixel_index { 0 };
std::array<Color, 240> spectrum_row = { 0 };
ChannelSpectrumFIFO* fifo { nullptr };
uint8_t max_power = 0;
Labels labels{
{{0, 0}, "MIN: MAX: LNA VGA ", Color::light_grey()},
{{0, 1 * 16}, " RANGE: FILTER: AMP:", Color::light_grey()},
{{0, 2 * 16}, "PRESET:", Color::light_grey()},
{{0, 3 * 16}, "MARKER: MHz +/- MHz", Color::light_grey()},
{{0, 4 * 16}, "RESOLUTION: (fft trigger)", Color::light_grey()}
};
NumberField field_frequency_min {
{ 4 * 8, 0 * 16 },
4,
{ 0, 6960 },
240,
' '
};
NumberField field_frequency_max {
{ 13 * 8, 0 * 16 },
4,
{ 240, 7200 },
240,
' '
};
LNAGainField field_lna {
{ 21 * 8, 0 * 16 }
};
VGAGainField field_vga {
{ 27 * 8, 0 * 16 }
};
Text text_range{
{7 * 8, 1 * 16, 4 * 8, 16},
""};
OptionsField filter_config{
{19 * 8, 1 * 16},
4,
struct preset_entry
{
{"OFF ", 0},
{"MID ", 118}, //85 +25 (110) + a bit more to kill all blue
{"HIGH", 202}, //168 + 25 (193)
}};
rf::Frequency min{};
rf::Frequency max{};
std::string label{};
};
const Style style_white { // free range
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::white(),
};
RFAmpField field_rf_amp{
{29 * 8, 1 * 16}};
const Style style_red { // locked range
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::red(),
};
OptionsField range_presets{
{7 * 8, 2 * 16},
20,
{
{" NONE (WIFI 2.4GHz)", 0},
}};
std::vector<preset_entry> presets_db{};
// Each slice bandwidth 20 MHz and a multiple of 256
// since we are using LOOKING_GLASS_SLICE_WIDTH/256 as the each_bin_size
// it should also be a multiple of 2 since we are using LOOKING_GLASS_SLICE_WIDTH / 2 as centering freq
int64_t LOOKING_GLASS_SLICE_WIDTH = 20000000;
NumberField field_marker{
{7 * 8, 3 * 16},
4,
{0, 7200},
25,
' '};
// frequency rounding helpers
int64_t next_mult_of(int64_t num, int64_t multiplier);
void adjust_range(int64_t* f_min, int64_t* f_max, int64_t width);
Text text_marker_pm{
{20 * 8, 3 * 16, 2 * 8, 16},
""};
void on_channel_spectrum(const ChannelSpectrum& spectrum);
void do_timers();
void on_range_changed();
void on_lna_changed(int32_t v_db);
void on_vga_changed(int32_t v_db);
void reset_live_view( bool clear_screen );
void add_spectrum_pixel(uint8_t power);
void PlotMarker(rf::Frequency pos);
void load_Presets();
void txtline_process(std::string& line);
void populate_Presets();
void presets_Default();
NumberField field_trigger{
{11 * 8, 4 * 16},
3,
{2, 128},
2,
' '};
rf::Frequency f_min { 0 }, f_max { 0 };
rf::Frequency search_span { 0 };
rf::Frequency f_center { 0 };
rf::Frequency f_center_ini { 0 };
rf::Frequency marker { 0 };
rf::Frequency marker_pixel_step { 0 };
rf::Frequency each_bin_size { LOOKING_GLASS_SLICE_WIDTH / 256 };
rf::Frequency bins_Hz_size { 0 };
uint8_t min_color_power { 0 };
uint32_t pixel_index { 0 };
std::array<Color, 240> spectrum_row = { 0 };
std::array<uint8_t, 240> spectrum_data = { 0 };
ChannelSpectrumFIFO* fifo { nullptr };
uint8_t max_power = 0;
int32_t steps = 0 ;
uint8_t live_frequency_view = 0 ;
int16_t live_frequency_integrate = 3 ;
int64_t max_freq_hold = 0 ;
int16_t max_freq_power = -1000 ;
bool fast_scan = true ; // default to legacy fast scan
bool locked_range = false ;
Labels labels{
{{0, 0}, "MIN: MAX: LNA VGA ", Color::light_grey()},
{{0, 1 * 16}, "RANGE: FILTER: AMP:", Color::light_grey()},
{{0, 2 * 16}, "PRESET:", Color::light_grey()},
{{0, 3 * 16}, "MARKER: MHz", Color::light_grey()},
{{0, 4 * 16}, "RES: STEP:", Color::light_grey()}
};
MessageHandlerRegistration message_handler_spectrum_config {
Message::ID::ChannelSpectrumConfig,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const ChannelSpectrumConfigMessage*>(p);
this->fifo = message.fifo;
}
};
MessageHandlerRegistration message_handler_frame_sync {
Message::ID::DisplayFrameSync,
[this](const Message* const) {
if( this->fifo ) {
ChannelSpectrum channel_spectrum;
while( fifo->out(channel_spectrum) ) {
this->on_channel_spectrum(channel_spectrum);
}
}
}
};
NumberField field_frequency_min {
{ 4 * 8, 0 * 16 },
4,
{ 0, 7199 },
1, // number of steps by encoder delta
' '
};
};
}
NumberField field_frequency_max {
{ 13 * 8, 0 * 16 },
4,
{ 1, 7200 },
1, // number of steps by encoder delta
' '
};
LNAGainField field_lna {
{ 21 * 8, 0 * 16 }
};
VGAGainField field_vga {
{ 27 * 8, 0 * 16 }
};
Button button_range{
{7 * 8, 1 * 16, 4 * 8, 16},
""};
OptionsField filter_config{
{20 * 8, 1 * 16},
4,
{
{"OFF ", 0},
{"MID ", 118}, //85 +25 (110) + a bit more to kill all blue
{"HIGH", 202}, //168 + 25 (193)
}};
RFAmpField field_rf_amp{
{29 * 8, 1 * 16}};
OptionsField range_presets{
{7 * 8, 2 * 16},
20,
{
{" NONE (WIFI 2.4GHz)", 0},
}};
ButtonWithEncoder button_marker{
{7 * 8, 3 * 16 , 10 * 8 , 16},
" "
};
NumberField field_trigger{
{4 * 8, 4 * 16},
3,
{2, 128},
2,
' '};
OptionsField steps_config{
{ 13 * 8, 4 * 16},
3,
{
{"1", 1},
{"25", 25},
{"50", 50},
{"100", 100},
{"250", 250},
{"500", 500},
}
};
OptionsField scan_type{
{ 17 * 8, 4 * 16},
2,
{
{"F-", true },
{"S-", false },
}
};
OptionsField view_config{
{ 19 * 8, 4 * 16},
7,
{
{"SPCTR-V", 0 },
{"LEVEL-V", 1 },
{"PEAK-V" , 2 },
}
};
OptionsField level_integration{
{ 27 * 8, 4 * 16},
2,
{
{"x0", 0 },
{"x1", 1 },
{"x2", 2 },
{"x3", 3 },
{"x4", 4 },
{"x5", 5 },
{"x6", 6 },
{"x7", 7 },
{"x8", 8 },
{"x9", 9 },
}};
Button button_jump {
{ 240 - 4 * 8 , 5 * 16 , 4 * 8, 16 },
"JMP"
};
Button button_rst {
{ 240 - 9 * 8 , 5 * 16 , 4 * 8, 16 },
"RST"
};
Text freq_stats{
{0 * 8, 5 * 16 , 240 - 10 * 8 , 8 },
""
};
MessageHandlerRegistration message_handler_spectrum_config {
Message::ID::ChannelSpectrumConfig,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const ChannelSpectrumConfigMessage*>(p);
this->fifo = message.fifo;
}
};
MessageHandlerRegistration message_handler_frame_sync {
Message::ID::DisplayFrameSync,
[this](const Message* const) {
if( this->fifo ) {
ChannelSpectrum channel_spectrum;
while( fifo->out(channel_spectrum) ) {
this->on_channel_spectrum(channel_spectrum);
}
}
}
};
};
}
#endif
+265 -21
View File
@@ -24,8 +24,13 @@
#include "baseband_api.hpp"
#include "audio.hpp"
#include "wm8731.hpp"
using wolfson::wm8731::WM8731;
#include "tonesets.hpp"
#include "portapack_hal.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp"
#include "irq_controls.hpp"
@@ -34,6 +39,10 @@
using namespace tonekey;
using namespace portapack;
WM8731 audio_codec_wm8731 { i2c0, 0x1a };
namespace ui {
void MicTXView::focus() {
@@ -65,8 +74,14 @@ void MicTXView::configure_baseband() {
sampling_rate / 20, // Update vu-meter at 20Hz
transmitting ? transmitter_model.channel_bandwidth() : 0,
mic_gain,
TONES_F2D(tone_key_frequency(tone_key_index), sampling_rate)
shift_bits_s16, // to be used in dsp_modulate
TONES_F2D(tone_key_frequency(tone_key_index), sampling_rate),
enable_am,
enable_dsb,
enable_usb,
enable_lsb
);
}
void MicTXView::set_tx(bool enable) {
@@ -143,27 +158,48 @@ void MicTXView::rxaudio(bool is_on) {
if (is_on) {
audio::input::stop();
baseband::shutdown();
baseband::run_image(portapack::spi_flash::image_tag_nfm_audio);
receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio);
if (enable_am || enable_usb || enable_lsb || enable_dsb) { // "NFM/FM",0 ," WFM ",1 , " AM ",2, " USB ", 3, " LSB ",4, " DSB-SC", 5
baseband::run_image(portapack::spi_flash::image_tag_am_audio);
receiver_model.set_modulation(ReceiverModel::Mode::AMAudio); // that AM demodulation engine is common to all Amplitude mod : AM/USB/LSB/DSB (2,3,4,5)
if (options_mode.selected_index() < 5) // We will be called here with 2,3,4,5 . We treat here demod. filter 2,3,4; (excluding DSB-C case (5) it is treated more down).
receiver_model.set_am_configuration(options_mode.selected_index() - 1); // selecting proper filter(2,3,4). 2-1=1=>6k-AM(1) , 3-1=2=>+3k-USB(2), 4-1=3=>-3K-LSB(3),
}
else { // We are in NFM/FM or WFM (NFM BW:8k5 or 11k / FM BW 16k / WFM BW:200k)
if (enable_wfm) { // WFM , BW 200Khz aprox ,
baseband::run_image(portapack::spi_flash::image_tag_wfm_audio);
receiver_model.set_modulation(ReceiverModel::Mode::WidebandFMAudio);
receiver_model.set_wfm_configuration(0); // there are only 1 x config filters 200k WFM . (not like 8k5/11k/16k)
} else { // NFM BW:8k5 or 11k / FM BW 16k
baseband::run_image(portapack::spi_flash::image_tag_nfm_audio);
receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio); //
// receiver_model.set_nbfm_configuration(n); is called above , depending 8k5, 11k, 16k
}
}
receiver_model.set_sampling_rate(3072000);
receiver_model.set_baseband_bandwidth(1750000);
// receiver_model.set_tuning_frequency(field_frequency.value()); //probably this too can be commented out.
receiver_model.set_tuning_frequency(rx_frequency); // Now with seperate controls!
if (bool_same_F_tx_rx_enabled) // when stop TX ,define to which freq RX we return
receiver_model.set_tuning_frequency(tx_frequency); // Update freq also for RX = TX
else
receiver_model.set_tuning_frequency(rx_frequency); // Now with seperate freq controls!
receiver_model.set_lna(rx_lna);
receiver_model.set_vga(rx_vga);
receiver_model.set_rf_amp(rx_amp);
receiver_model.enable();
hackrf::cpld::load_sram_no_verify(); // to have a good RX without any ghost inside Mic App
audio::output::start();
} else { //These incredibly convoluted steps are required for the vumeter to reappear when stopping RX.
receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio); //This fixes something with AM RX...
receiver_model.disable();
baseband::shutdown();
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
audio::input::start();
// transmitter_model.enable();
audio::output::stop();
audio::input::start(ak4951_alc_and_wm8731_boost_GUI); // When detected AK4951 => set up ALC mode; when detected WM8731 => set up mic_boost ON/OFF.
portapack::pin_i2s0_rx_sda.mode(3);
// transmitting = false;
configure_baseband();
// transmitter_model.disable();
}
}
@@ -186,10 +222,12 @@ MicTXView::MicTXView(
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
add_children({
&labels,
if (audio::debug::codec_name() =="WM8731" ) {
add_children({
&labels_WM8731, // we have audio codec WM8731, same MIC menu as original.
&vumeter,
&options_gain,
&options_gain, // MIC GAIN float factor on the GUI.
&options_wm8731_boost_mode,
// &check_va,
&field_va,
&field_va_level,
@@ -198,11 +236,14 @@ MicTXView::MicTXView(
&field_bw,
&field_rfgain,
&field_rfamp,
&options_mode,
&field_frequency,
&options_tone_key,
&check_rogerbeep,
&check_common_freq_tx_rx, // added to handle common or separate freq- TX/RX
&check_rxactive,
&field_volume,
&field_rxbw,
&field_squelch,
&field_rxfrequency,
&field_rxlna,
@@ -210,6 +251,38 @@ MicTXView::MicTXView(
&field_rxamp,
&tx_button
});
} else {
add_children({
&labels_AK4951, // we have audio codec AK4951, enable Automatic Level Control
&vumeter,
&options_gain,
&options_ak4951_alc_mode,
// &check_va,
&field_va,
&field_va_level,
&field_va_attack,
&field_va_decay,
&field_bw,
&field_rfgain,
&field_rfamp,
&options_mode,
&field_frequency,
&options_tone_key,
&check_rogerbeep,
&check_common_freq_tx_rx, // added to handle common or separate freq- TX/RX
&check_rxactive,
&field_volume,
&field_rxbw,
&field_squelch,
&field_rxfrequency,
&field_rxlna,
&field_rxvga,
&field_rxamp,
&tx_button
});
}
tone_keys_populate(options_tone_key);
options_tone_key.on_change = [this](size_t i, int32_t) {
@@ -221,15 +294,55 @@ MicTXView::MicTXView(
mic_gain = v / 10.0;
configure_baseband();
};
options_gain.set_selected_index(1); // x1.0
options_gain.set_selected_index(1); // x1.0 preselected default.
if (audio::debug::codec_name() =="WM8731") {
options_wm8731_boost_mode.on_change = [this](size_t, int8_t v) {
switch(v) {
case 0: // +12 dBs respect reference level orig fw 1.5.x fw FM : when +20dB's boost ON) and shift bits (>>8),
shift_bits_s16 = 6; // now mic-boost on (+20dBs) and shift bits (>>6), +20+12=32 dBs (orig fw +20 dBs+ 0dBs)=> +12dB's respect ref.
break;
case 1: // +06 dBs reference level , (when +20dB's boost ON)
shift_bits_s16 = 7; // now mic-boost on (+20dBs) and shift bits (>>7), +20+06=26 dBs (orig fw +20 dBs+ 0dBs) => +06dB's respect ref.
break;
case 2:
shift_bits_s16 = 4; // +04 dBs respect ref level , (when +20dB's boost OFF)
break; // now mic-boost off (+00dBs) shift bits (4) (+0+24dB's)=24 dBs => +04dB's respect ref.
case 3:
shift_bits_s16 = 5; // -02 dBs respect ref level , (when +20dB's boost OFF)
break; // now mic-boost off (+00dBs) shift bits (5) (+0+18dB's)=18 dBs => -02dB's respect ref.
case 4:
shift_bits_s16 = 6; // -08 dBs respect ref level , (when +20dB's boost OFF)
break; // now mic-boost off (+00dBs) shift bits (6) (+0+12dB's)=12 dBs => -08dB's respect ref.
}
ak4951_alc_and_wm8731_boost_GUI = v; // 0,..4 WM8731_boost dB's options, (combination boost on/off , and effective gain in captured data >>x)
audio::input::start(ak4951_alc_and_wm8731_boost_GUI); // Detected (WM8731) , set up the proper wm_boost on/off , 0..4 (0,1) boost_on , (2,3,4) boost_0ff
configure_baseband(); // to update in real timme,sending msg , var-parameters >>shift_bits FM msg ,to audio_tx from M0 to M4 Proc -
};
options_wm8731_boost_mode.set_selected_index(3); // preset GUI index 3 as default WM -> -02 dB's .
} else {
shift_bits_s16 = 8; // Initialized default fixed >>8_FM for FM tx mod , shift audio data for AK4951 ,using top 8 bits s16 data (>>8)
options_ak4951_alc_mode.on_change = [this](size_t, int8_t v) {
ak4951_alc_and_wm8731_boost_GUI = v; // 0,..11, AK4951 Mic -Automatic volume Level Control options,
audio::input::start(ak4951_alc_and_wm8731_boost_GUI); // Detected (AK4951) ==> Set up proper ALC mode from 0..11 options
configure_baseband(); // sending fixed >>8_FM , var-parameters msg , to audiotx from this M0 to M4 process.
};
}
// options_ak4951_alc_mode.set_selected_index(0);
tx_frequency = transmitter_model.tuning_frequency();
field_frequency.set_value(transmitter_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step());
field_frequency.on_change = [this](rf::Frequency f) {
tx_frequency = f;
if(!rx_enabled)
if(!rx_enabled) { // not activated receiver. just update freq TX
transmitter_model.set_tuning_frequency(f);
} else { // activated receiver.
if (bool_same_F_tx_rx_enabled) // user selected common freq- TX = RX
receiver_model.set_tuning_frequency(f); //Update common freq also for RX
}
};
field_frequency.on_edit = [this, &nav]() {
focused_ui = 0;
@@ -237,8 +350,12 @@ MicTXView::MicTXView(
auto new_view = nav.push<FrequencyKeypadView>(tx_frequency);
new_view->on_changed = [this](rf::Frequency f) {
tx_frequency = f;
if(!rx_enabled)
if(!rx_enabled) {
transmitter_model.set_tuning_frequency(f);
} else {
if (bool_same_F_tx_rx_enabled)
receiver_model.set_tuning_frequency(f); //Update freq also for RX
}
this->field_frequency.set_value(f);
set_dirty();
};
@@ -247,7 +364,8 @@ MicTXView::MicTXView(
field_bw.on_change = [this](uint32_t v) {
transmitter_model.set_channel_bandwidth(v * 1000);
};
field_bw.set_value(10);
field_bw.set_value(10); // pre-default first time, TX deviation FM for NFM / FM
tx_gain = transmitter_model.tx_gain();
field_rfgain.on_change = [this](int32_t v) {
@@ -262,6 +380,108 @@ MicTXView::MicTXView(
};
field_rfamp.set_value(rf_amp ? 14 : 0);
options_mode.on_change = [this](size_t, int32_t v) { //{ "NFM/FM", 0 }, { " WFM ", 1 },{ "AM", 2 },{ "USB", 3 },{ "LSB", 4 },{ "DSB", 5 }
enable_am = false;
enable_usb = false;
enable_lsb = false;
enable_dsb = false;
enable_wfm = false;
using option_t = std::pair<std::string, int32_t>;
using options_t = std::vector<option_t>;
options_t rxbw; // Aux structure to change dynamically field_rxbw contents,
switch(v) {
case 0: //{ "FM", 0 }
enable_am = false;
enable_usb = false;
enable_lsb = false;
enable_dsb = false;
field_bw.set_value(10); // pre-default deviation FM for WFM
// field_bw.set_value(transmitter_model.channel_bandwidth() / 1000);
//if (rx_enabled)
rxaudio(rx_enabled); //Update now if we have RX audio on
options_tone_key.hidden(0); // we are in FM mode , we should have active the Key-tones & CTCSS option.
rxbw.emplace_back(" NFM1:8k5 ", 0); // restore the original dynamic field_rxbw value.
rxbw.emplace_back(" NFM2:11k ", 1);
rxbw.emplace_back(" FM :16k ", 2);
field_rxbw.set_options(rxbw); // store that aux GUI option to the field_rxbw.
field_rxbw.hidden(0); // we are in FM mode, we need to allow the user set up of the RX NFM BW selection (8K5, 11K, 16K)
field_bw.hidden(0); // we are in FM mode, we need to allow FM deviation parameter , in non FM mode.
break;
case 1: //{ "WFM", 1 }
enable_am = false;
enable_usb = false;
enable_lsb = false;
enable_dsb = false;
enable_wfm = true;
field_bw.set_value(75); // pre-default deviation FM for WFM
// field_bw.set_value(transmitter_model.channel_bandwidth() / 1000);
//if (rx_enabled)
rxaudio(rx_enabled); //Update now if we have RX audio on
options_tone_key.hidden(0); // we are in WFM mode , we should have active the Key-tones & CTCSS option.
rxbw.emplace_back(" 200k-WFM ", 0); // locked a fixed option , to display it .
field_rxbw.set_options(rxbw); // store that aux GUI option to the field_rxbw.
field_rxbw.hidden(0); // we are in WFM mode, we need to show to the user the selected BW WFM filer .
field_bw.hidden(0); // we are in WFM mode, we need to allow WFM deviation parameter , in non FM mode.
break;
case 2: //{ "AM", 2 }
enable_am = true;
rxaudio(rx_enabled); //Update now if we have RX audio on
options_tone_key.set_selected_index(0); // we are NOT in FM mode , we reset the possible previous key-tones &CTCSS selection.
set_dirty(); // Refresh display
options_tone_key.hidden(1); // we hide that Key-tones & CTCSS input selecction, (no meaning in AM/DSB/SSB).
rxbw.emplace_back(" DSB1-9k ", 0); // we offer in AM DSB two audio BW 9k / 6k .
rxbw.emplace_back(" DSB2-6k ", 1);
field_rxbw.set_options(rxbw); // store that aux GUI option to the field_rxbw.
field_rxbw.hidden(0); // we show fixed RX AM BW 6Khz
field_bw.hidden(1); // we hide the FM TX deviation parameter , in non FM mode.
check_rogerbeep.hidden(0); // make visible again the "rogerbeep" selection.
break;
case 3: //{ "USB", 3 }
enable_usb = true;
rxaudio(rx_enabled); //Update now if we have RX audio on
check_rogerbeep.set_value(false); // reset the possible activation of roger beep, because it is not compatible with SSB , by now.
check_rogerbeep.hidden(1); // hide that roger beep selection.
rxbw.emplace_back(" USB+3k ", 0); // locked a fixed option , to display it .
field_rxbw.set_options(rxbw); // store that aux GUI option to the field_rxbw.
set_dirty(); // Refresh display
break;
case 4: //{ "LSB", 4 }
enable_lsb = true;
rxaudio(rx_enabled); //Update now if we have RX audio on
check_rogerbeep.set_value(false); // reset the possible activation of roger beep, because it is not compatible with SSB , by now.
check_rogerbeep.hidden(1); // hide that roger beep selection.
rxbw.emplace_back(" LSB-3k ", 0); // locked a fixed option , to display it .
field_rxbw.set_options(rxbw); // store that aux GUI option to the field_rxbw.
set_dirty(); // Refresh display
break;
case 5: //{ "DSB-SC", 5 }
enable_dsb = true;
rxaudio(rx_enabled); //Update now if we have RX audio on
check_rogerbeep.hidden(0); // make visible again the "rogerbeep" selection.
rxbw.emplace_back("SSB1:USB+3k", 0); // added dynamically two options (index 0,1) to that DSB-C case to the field_rxbw value.
rxbw.emplace_back("SSB2:LSB-3k", 1);
field_rxbw.set_options(rxbw); // store that aux GUI option to the field_rxbw.
break;
}
//configure_baseband();
};
/*
check_va.on_select = [this](Checkbox&, bool v) {
va_enabled = v;
@@ -304,6 +524,13 @@ MicTXView::MicTXView(
rogerbeep_enabled = v;
};
check_common_freq_tx_rx.on_select = [this](Checkbox&, bool v) {
bool_same_F_tx_rx_enabled = v;
field_rxfrequency.hidden(v); //Hide or show separated freq RX field . (When no hide user can enter down indep. freq for RX)
set_dirty(); //Refresh GUI interface
receiver_model.set_tuning_frequency(v ? tx_frequency : rx_frequency); // To go to the proper tuned freq. when toggling it
};
field_va_level.on_change = [this](int32_t v) {
va_level = v;
vumeter.set_mark(v);
@@ -331,6 +558,22 @@ MicTXView::MicTXView(
field_volume.set_value((receiver_model.headphone_volume() - audio::headphone::volume_range().max).decibel() + 99);
field_volume.on_change = [this](int32_t v) { this->on_headphone_volume_changed(v); };
field_rxbw.on_change = [this](size_t, int32_t v) {
if (!(enable_am || enable_usb || enable_lsb || enable_dsb || enable_wfm )) {
// In Previous fw versions, that nbfm_configuration(n) was done in any mode (FM/AM/SSB/DSB)...strictly speaking only need it in (NFM/FM)
receiver_model.set_nbfm_configuration(v ); // we are in NFM/FM case, we need to select proper NFM/FM RX channel filter , NFM BW 8K5(0), NFM BW 11K(1) , FM BW 16K (2)
}
else { // we are not in NFM/FM mode .(we could be in any of the rest : AM /USB/LSB/DSB-SC)
if (enable_am) { // we are in AM TX mode , we will allow both independent RX audio BW : AM 9K (9K00AE3 / AM 6K (6K00AE3). (In AM option v can be 0 (9k) , 1 (6k)
receiver_model.set_am_configuration(v ); // we are in AM TX mode , we need to select proper AM full path config AM-9K filter. 0+0 =>AM-9K(0), 0+1=1 =>AM-6K(1),
}
if (enable_dsb) { // we are in DSB-SC in TX mode , we will allow both independent RX SSB demodulation (USB / LSB side band). in that submenu, v is 0 (SSB1 USB) or 1 (SSB2 LSB)
receiver_model.set_am_configuration(v +2 ); // we are in DSB-SC TX mode , we need to select proper SSB filter. 0+2 =>usb(2), 1+2=3 =>lsb(3),
}
}
};
field_squelch.on_change = [this](int32_t v) {
receiver_model.set_squelch_level(100 - v);
};
@@ -340,12 +583,12 @@ MicTXView::MicTXView(
rx_frequency = receiver_model.tuning_frequency();
field_rxfrequency.set_value(rx_frequency);
field_rxfrequency.set_step(receiver_model.frequency_step());
field_rxfrequency.on_change = [this](rf::Frequency f) {
field_rxfrequency.on_change = [this](rf::Frequency f) { // available when field rxfrequency not hidden => user selected separated freq RX/TX-
rx_frequency = f;
if(rx_enabled)
receiver_model.set_tuning_frequency(f);
};
field_rxfrequency.on_edit = [this, &nav]() {
field_rxfrequency.on_edit = [this, &nav]() { // available when field rxfrequency not hidden => user selected separated freq RX/TX-
focused_ui = 1;
// TODO: Provide separate modal method/scheme?
auto new_view = nav.push<FrequencyKeypadView>(rx_frequency);
@@ -406,9 +649,9 @@ MicTXView::MicTXView(
transmitter_model.set_baseband_bandwidth(1750000);
set_tx(false);
audio::set_rate(audio::Rate::Hz_24000);
audio::input::start();
audio::set_rate(audio::Rate::Hz_24000);
audio::input::start(ak4951_alc_and_wm8731_boost_GUI); // When detected AK4951 => set up ALC mode; when detected WM8731 => set up mic_boost ON/OFF.
}
MicTXView::~MicTXView() {
@@ -417,7 +660,8 @@ MicTXView::~MicTXView() {
transmitter_model.disable();
if (rx_enabled) //Also turn off audio rx if enabled
rxaudio(false);
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
}
+111 -16
View File
@@ -58,7 +58,7 @@ public:
};
*/
std::string title() const override { return "Mic TX RX"; };
std::string title() const override { return "Microphone"; };
private:
static constexpr uint32_t sampling_rate = 1536000U;
@@ -80,9 +80,11 @@ private:
bool va_enabled { false };
bool ptt_enabled { true };
bool rogerbeep_enabled { false };
bool bool_same_F_tx_rx_enabled { false };
bool rx_enabled { false };
uint32_t tone_key_index { };
float mic_gain { 1.0 };
uint8_t ak4951_alc_and_wm8731_boost_GUI { 0 };
uint32_t audio_level { 0 };
uint32_t va_level { };
uint32_t attack_ms { };
@@ -98,27 +100,59 @@ private:
rf::Frequency rx_frequency { 0 };
int32_t focused_ui { 2 };
bool button_touch { false };
uint8_t shift_bits_s16 {4} ; // shift bits factor to the captured ADC S16 audio sample.
//AM TX Stuff
bool enable_am { false };
bool enable_dsb { false };
bool enable_usb { false };
bool enable_lsb { false };
bool enable_wfm { false }; // added to distinguish in the FM mode , RX BW : NFM (8K5, 11K), FM (16K), WFM(200K)
Labels labels {
{ { 3 * 8, 1 * 8 }, "MIC. GAIN:", Color::light_grey() },
Labels labels_WM8731 {
{ { 3 * 8, 1 * 8 }, "MIC-GAIN:", Color::light_grey() },
{ { 17 * 8, 1 * 8 }, "Boost", Color::light_grey() },
{ { 3 * 8, 3 * 8 }, "F:", Color::light_grey() },
{ { 15 * 8, 3 * 8 }, "BW: kHz", Color::light_grey() },
{ { 15 * 8, 3 * 8 }, "FM TXBW: kHz", Color::light_grey() }, // to be more symetric and consistent to the below FM RXBW
{ { 3 * 8, 5 * 8 }, "GAIN:", Color::light_grey() },
{ {11 * 8, 5 * 8 }, "Amp:", Color::light_grey() },
{ { 18 * 8, (5 * 8) }, "Mode:", Color::light_grey() },
{ { 3 * 8, 8 * 8 }, "TX Activation:", Color::light_grey() },
{ { 4 * 8, 10 * 8 }, "LVL:", Color::light_grey() },
{ {12 * 8, 10 * 8 }, "ATT:", Color::light_grey() },
{ {20 * 8, 10 * 8 }, "DEC:", Color::light_grey() },
{ { 4 * 8, ( 13 * 8 ) - 2 }, "TONE KEY:", Color::light_grey() },
{ { 9 * 8, 23 * 8 }, "VOL:", Color::light_grey() },
{ {17 * 8, 25 * 8 }, "SQ:", Color::light_grey() },
{ { 5 * 8, 25 * 8 }, "F:", Color::light_grey() },
{ { 7 * 8, 23 * 8 }, "VOL:", Color::light_grey() },
{ {14 * 8, 23 * 8 }, "RXBW:", Color::light_grey() }, //we remove the label "FM" because we will display all MOD types RX_BW.
{ {20 * 8, 25 * 8 }, "SQ:", Color::light_grey() },
{ { 5 * 8, 25 * 8 }, "F_RX:", Color::light_grey() },
{ { 5 * 8, 27 * 8 }, "LNA:", Color::light_grey()},
{ {12 * 8, 27 * 8 }, "VGA:", Color::light_grey()},
{ {19 * 8, 27 * 8 }, "AMP:", Color::light_grey()}
};
Labels labels_AK4951 {
{ { 3 * 8, 1 * 8 }, "MIC-GAIN:", Color::light_grey() },
{ { 17 * 8, 1 * 8 }, "ALC", Color::light_grey() },
{ { 3 * 8, 3 * 8 }, "F:", Color::light_grey() },
{ { 15 * 8, 3 * 8 }, "FM TXBW: kHz", Color::light_grey() },
{ { 3 * 8, 5 * 8 }, "GAIN:", Color::light_grey() },
{ {11 * 8, 5 * 8 }, "Amp:", Color::light_grey() },
{ { 18 * 8, (5 * 8) }, "Mode:", Color::light_grey() },
{ { 3 * 8, 8 * 8 }, "TX Activation:", Color::light_grey() },
{ { 4 * 8, 10 * 8 }, "LVL:", Color::light_grey() },
{ {12 * 8, 10 * 8 }, "ATT:", Color::light_grey() },
{ {20 * 8, 10 * 8 }, "DEC:", Color::light_grey() },
{ { 4 * 8, ( 13 * 8 ) - 2 }, "TONE KEY:", Color::light_grey() },
{ { (6 * 8)+4, 23 * 8 }, "VOL:", Color::light_grey() },
{ {14 * 8, 23 * 8 }, "RXBW:", Color::light_grey() }, //we remove the label "FM" because we will display all MOD types RX_BW.
{ {20 * 8, 25 * 8 }, "SQ:", Color::light_grey() },
{ { 5 * 8, 25 * 8 }, "F_RX:", Color::light_grey() },
{ { 5 * 8, 27 * 8 }, "LNA:", Color::light_grey()},
{ {12 * 8, 27 * 8 }, "VGA:", Color::light_grey()},
{ {19 * 8, 27 * 8 }, "AMP:", Color::light_grey()}
};
VuMeter vumeter {
{ 0 * 8, 1 * 8, 2 * 8, 33 * 8 },
12,
@@ -127,7 +161,7 @@ private:
OptionsField options_gain {
{ 13 * 8, 1 * 8 },
{ 12 * 8, 1 * 8 },
4,
{
{ "x0.5", 5 },
@@ -137,11 +171,42 @@ private:
}
};
OptionsField options_ak4951_alc_mode {
{ 20 * 8, 1 * 8 }, // Coordinates are: int:x (px), int:y (px)
11,
{
{ " OFF-12kHz", 0 }, // Nothing changed from ORIGINAL,keeping ALL programmable AK4951 Digital Block->OFF, sampling 24Khz)
{ "+12dB-6kHz", 1 }, // ALC-> on, (+12dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
{ "+09dB-6kHz", 2 }, // ALC-> on, (+09dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
{ "+06dB-6kHz", 3 }, // ALC-> on, (+06dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
{ "+03dB-2kHz", 4 }, // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + LPF 3,5k + Pre-amp Mic (+21dB=original)+ EQ boosting ~<2kHz (f0~1k1,fb:1,7K, k=1,8)
{ "+03dB-4kHz", 5 }, // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + LPF 4kHz + Pre-amp Mic (+21dB=original)+ EQ boosting ~<3kHz (f0~1k4,fb~2,4k, k=1,8)
{ "+03dB-6kHz", 6 }, // ALC-> on, (+03dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
{ "+00dB-6kHz", 7 }, // ALC-> on, (+00dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
{ "-03dB-6kHz", 8 }, // ALC-> on, (-03dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
{ "-06dB-6kHz", 9 }, // ALC-> on, (-06dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz + Pre-amp Mic (+21dB=original)
{ "-09dB-6kHz", 10 }, // ALC-> on, (-09dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz - Pre-amp MIC -3dB (18dB's)
{ "-12dB-6kHz", 11 }, // ALC-> on, (-12dB's) Auto Vol max + Wind Noise cancel + LPF 6kHz - Pre-amp MIC -6dB (15dB's)
}
};
OptionsField options_wm8731_boost_mode {
{ 22 * 8, 1 * 8 }, // Coordinates are: int:x (px), int:y (px)
5,
{
{ "ON +12dB", 0 }, // WM8731 Mic Boost ON ,original+12dBs condition, easy to saturate ADC sat in high voice ,relative G = +12 dB's respect ref level
{ "ON +06dB", 1 }, // WM8731 Mic Boost ON ,original+6 dBs condition, easy to saturate ADC sat in high voice ,relative G = +06 dB's respect ref level
{ "OFF+04dB", 2 }, // WM8731 Mic Boost OFF to avoid ADC sat in high voice ,relative G = +04 dB's (respect ref level) , always effective sampling 24khz
{ "OFF-02dB", 3 }, // WM8731 Mic Boost OFF to avoid ADC sat in high voice ,relative G = -02 dB's (respect ref level)
{ "OFF-08dB", 4 }, // WM8731 Mic Boost OFF to avoid ADC sat in high voice ,relative G = -12 dB's (respect ref level)
}
};
FrequencyField field_frequency {
{ 5 * 8, 3 * 8 },
};
NumberField field_bw {
{ 18 * 8, 3 * 8 },
{ 23 * 8, 3 * 8 },
3,
{ 0, 150 },
1,
@@ -162,6 +227,19 @@ private:
14,
' '
};
OptionsField options_mode {
{ 24 * 8, 5 * 8 },
4,
{
{ "NFM/FM", 0 },
{ " WFM ", 1 },
{ " AM ", 2 }, // in fact that TX mode = AM -DSB with carrier .
{ " USB ", 3 },
{ " LSB ", 4 },
{ "DSB-SC", 5 } // We are TX Double Side AM Band with suppressed carrier, and allowing in RX both indep SSB lateral band (USB/LSB).
}
};
/*
Checkbox check_va {
{ 3 * 8, (10 * 8) - 4 },
@@ -210,7 +288,7 @@ private:
};
Checkbox check_rogerbeep {
{ 3 * 8, ( 16 * 8 ) + 4 },
{ 3 * 8, ( 16 * 8 ) + 7 },
10,
"Roger beep",
false
@@ -218,21 +296,38 @@ private:
Checkbox check_rxactive {
{ 3 * 8, ( 21 * 8 ) - 4 },
8,
18, // it was 8, but if it is string size should be 18
"RX audio listening",
false
};
Checkbox check_common_freq_tx_rx {
{ 18 * 8, ( 16* 8 ) + 7 },
8,
"F = F_RX",
false
};
NumberField field_volume {
{ 13 * 8, 23 * 8 },
{ 11* 8, 23 * 8 },
2,
{ 0, 99 },
1,
' ',
};
OptionsField field_rxbw {
{ 19* 8, 23 * 8},
3,
{
{" NFM1:8k5 ", 0},
{" NFM2:11k ", 1},
{" FM :16k ", 2},
}
};
NumberField field_squelch {
{ 20 * 8, 25 * 8 },
{ 23 * 8, 25 * 8 },
2,
{ 0, 99 },
1,
@@ -240,7 +335,7 @@ private:
};
FrequencyField field_rxfrequency {
{ 7 * 8, 25 * 8 },
{ 10 * 8, 25 * 8 },
};
NumberField field_rxlna {
@@ -260,7 +355,7 @@ private:
};
NumberField field_rxamp {
{ 23 * 8, 27 * 8 },
{ 24 * 8, 27 * 8 },
1,
{ 0, 1 },
1,
+19 -3
View File
@@ -26,6 +26,7 @@
#include "baseband_api.hpp"
#include "hackrf_gpio.hpp"
#include "portapack_shared_memory.hpp"
#include "cpld_update.hpp"
#include "ui_textentry.hpp"
#include "string_format.hpp"
@@ -56,13 +57,13 @@ static msg_t ookthread_fn(void * arg) {
v = (symbol < 2) ? 1 : 0; // TX on for dot or dash, off for pause
delay = morse_symbols[symbol];
gpio_tx.write(v);
gpio_og_tx.write(v);
arg_c->on_tx_progress(i, false);
chThdSleepMilliseconds(delay * arg_c->time_unit_ms);
}
gpio_tx.write(0); // Ensure TX is off
gpio_og_tx.write(0); // Ensure TX is off
arg_c->on_tx_progress(0, true);
chThdExit(0);
@@ -97,8 +98,13 @@ void MorseView::focus() {
}
MorseView::~MorseView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_morse", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void MorseView::paint(Painter&) {
@@ -203,6 +209,15 @@ MorseView::MorseView(
&tx_view
});
// load app settings
auto rc = settings.load("tx_morse", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
// Default settings
field_speed.set_value(15); // 15wps
field_tone.set_value(700); // 700Hz FM tone
@@ -226,6 +241,7 @@ MorseView::MorseView(
};
options_loop.on_change = [this](size_t i, uint32_t n) {
(void)i; //avoid unused warning
loop = n;
};
+5 -1
View File
@@ -27,7 +27,7 @@
#include "ui_widget.hpp"
#include "ui_navigation.hpp"
#include "ui_transmitter.hpp"
#include "app_settings.hpp"
#include "portapack.hpp"
#include "message.hpp"
#include "volume.hpp"
@@ -67,6 +67,10 @@ private:
std::string message { };
uint32_t time_units { 0 };
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
enum modulation_t {
CW = 0,
FM = 1
+13
View File
@@ -60,6 +60,14 @@ NRFRxView::NRFRxView(NavigationView& nav) {
&console
});
// load app settings
auto rc = settings.load("rx_nrf", &app_settings);
if(rc == SETTINGS_OK) {
field_lna.set_value(app_settings.lna);
field_vga.set_value(app_settings.vga);
field_rf_amp.set_value(app_settings.rx_amp);
}
// DEBUG
record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message);
@@ -157,6 +165,11 @@ void NRFRxView::on_data(uint32_t value, bool is_data) {
}
NRFRxView::~NRFRxView() {
// save app settings
app_settings.rx_frequency = field_frequency.value();
settings.save("rx_nrf", &app_settings);
audio::output::stop();
receiver_model.disable();
baseband::shutdown();
+5
View File
@@ -27,6 +27,7 @@
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "app_settings.hpp"
#include "ui_record_view.hpp" // DEBUG
#include "utility.hpp"
@@ -45,6 +46,10 @@ public:
private:
void on_data(uint32_t value, bool is_data);
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
uint8_t console_color { 0 };
uint32_t prev_value { 0 };
std::string str_log { "" };
+328
View File
@@ -0,0 +1,328 @@
/*
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek
* Copyleft () 2022 NotPike
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_playlist.hpp"
#include "string_format.hpp"
#include "ui_fileman.hpp"
#include "io_file.hpp"
#include "baseband_api.hpp"
#include "portapack.hpp"
#include "portapack_persistent_memory.hpp"
#include <unistd.h>
using namespace portapack;
namespace ui {
void PlaylistView::set_ready() {
ready_signal = true;
}
void PlaylistView::load_file(std::filesystem::path playlist_path) {
File playlist_file;
auto error = playlist_file.open(playlist_path.string());
if (!error.is_valid()) {
std::string line;
char one_char[1];
for (size_t pointer =0 ; pointer < playlist_file.size(); pointer++) {
playlist_file.seek(pointer);
playlist_file.read(one_char, 1);
if ((int) one_char[0] >= ' ') {
line += one_char[0];
} else if (one_char[0] == '\n') {
txtline_process(line);
line.clear();
}
}
if (line.length() > 0) {
txtline_process(line);
}
}
playlist_masterdb = playlist_db;
return ;
}
void PlaylistView::txtline_process(std::string &line) {
playlist_entry new_item;
rf::Frequency f;
size_t previous = 0;
size_t current = line.find(',');
std::string freqs = line.substr(0, current);
previous = current +1;
current = line.find(',', previous);
std::string file = line.substr(previous, current - previous);
previous = current +1;
current = line.find(',', previous);
uint32_t sample_rate = strtoll(line.substr(previous).c_str(), nullptr, 10);
f = strtoll(freqs.c_str(), nullptr, 0);
new_item.replay_frequency = f;
new_item.replay_file = "/" + file;
new_item.sample_rate = sample_rate;
new_item.next_delay = 0;
playlist_db.push_back(std::move(new_item));
}
void PlaylistView::on_file_changed(std::filesystem::path new_file_path, rf::Frequency replay_frequency, uint32_t replay_sample_rate) {
File data_file;
// Get file size
auto data_open_error = data_file.open("/" + new_file_path.string());
if (data_open_error.is_valid()) {
file_error();
return;
}
file_path = new_file_path;
field_frequency.set_value(replay_frequency);
sample_rate = replay_sample_rate;
text_sample_rate.set(unit_auto_scale(sample_rate, 3, 0) + "Hz");
auto file_size = data_file.size();
auto duration = (file_size * 1000) / (2 * 2 * sample_rate);
progressbar.set_max(file_size);
text_filename.set(file_path.filename().string().substr(0, 12));
text_duration.set(to_string_time_ms(duration));
button_play.focus();
}
void PlaylistView::on_tx_progress(const uint32_t progress) {
progressbar.set_value(progress);
}
void PlaylistView::focus() {
button_open.focus();
}
void PlaylistView::file_error() {
nav_.display_modal("Error", "File "+file_path.string() +" read error. " +file_path.string());
}
bool PlaylistView::is_active() const {
return (bool)replay_thread;
}
bool PlaylistView::loop() const {
return (bool) playlist_db.size();
}
void PlaylistView::toggle() {
if( is_active() ) {
stop(false);
} else {
start();
}
}
void PlaylistView::start() {
stop(false);
playlist_entry item = playlist_db.front();
playlist_db.pop_front();
// playlist_entry item = playlist_db[0];
// for (playlist_entry item : playlist_db) {
// file_path = item.replay_file;
// rf::Frequency replay_frequency = strtoll(item.replay_frequency.c_str(),nullptr,10);
on_file_changed(item.replay_file, item.replay_frequency, item.sample_rate);
on_target_frequency_changed(item.replay_frequency);
std::unique_ptr<stream::Reader> reader;
auto p = std::make_unique<FileReader>();
auto open_error = p->open(file_path);
if( open_error.is_valid() ) {
file_error();
return; // Fixes TX bug if there's a file error
} else {
reader = std::move(p);
}
if( reader ) {
button_play.set_bitmap(&bitmap_stop);
baseband::set_sample_rate(sample_rate * 8);
replay_thread = std::make_unique<ReplayThread>(
std::move(reader),
read_size, buffer_count,
&ready_signal,
[](uint32_t return_code) {
ReplayThreadDoneMessage message { return_code };
EventDispatcher::send_message(message);
}
);
}
field_rfgain.on_change = [this](int32_t v) {
tx_gain = v;
};
field_rfgain.set_value(tx_gain);
receiver_model.set_tx_gain(tx_gain);
field_rfamp.on_change = [this](int32_t v) {
rf_amp = (bool)v;
};
field_rfamp.set_value(rf_amp ? 14 : 0);
//Enable Bias Tee if selected
radio::set_antenna_bias(portapack::get_antenna_bias());
radio::enable({
receiver_model.tuning_frequency(),
sample_rate * 8,
baseband_bandwidth,
rf::Direction::Transmit,
rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga())
});
// }
}
void PlaylistView::stop(const bool do_loop) {
if( is_active() ) {
replay_thread.reset();
}
if (do_loop) {
if (playlist_db.size() > 0 ) {
start();
} else {
playlist_db = playlist_masterdb;
start();
}
} else {
radio::set_antenna_bias(false); //Turn off Bias Tee
radio::disable();
button_play.set_bitmap(&bitmap_play);
}
ready_signal = false;
}
void PlaylistView::handle_replay_thread_done(const uint32_t return_code) {
if (return_code == ReplayThread::END_OF_FILE) {
stop(true);
} else if (return_code == ReplayThread::READ_ERROR) {
stop(false);
file_error();
}
progressbar.set_value(0);
}
PlaylistView::PlaylistView(
NavigationView& nav
) : nav_ (nav)
{
tx_gain = 35;field_rfgain.set_value(tx_gain); // Initial default value (-12 dB's max ).
field_rfamp.set_value(rf_amp ? 14 : 0); // Initial default value True. (TX RF amp on , +14dB's)
baseband::run_image(portapack::spi_flash::image_tag_replay);
add_children({
&labels,
&button_open,
&text_filename,
&text_sample_rate,
&text_duration,
&progressbar,
&field_frequency,
&field_rfgain,
&field_rfamp, // let's not use common rf_amp
&check_loop,
&button_play,
&waterfall,
});
field_frequency.set_value(target_frequency());
field_frequency.set_step(receiver_model.frequency_step());
field_frequency.on_change = [this](rf::Frequency f) {
this->on_target_frequency_changed(f);
};
field_frequency.on_edit = [this, &nav]() {
// TODO: Provide separate modal method/scheme?
auto new_view = nav.push<FrequencyKeypadView>(this->target_frequency());
new_view->on_changed = [this](rf::Frequency f) {
this->on_target_frequency_changed(f);
this->field_frequency.set_value(f);
};
};
field_frequency.set_step(5000);
button_play.on_select = [this](ImageButton&) {
this->toggle();
};
button_open.on_select = [this, &nav](Button&) {
auto open_view = nav.push<FileLoadView>(".TXT");
open_view->on_changed = [this](std::filesystem::path new_file_path) {
load_file(new_file_path);
};
};
}
PlaylistView::~PlaylistView() {
radio::disable();
baseband::shutdown();
}
void PlaylistView::on_hide() {
stop(false);
// TODO: Terrible kludge because widget system doesn't notify Waterfall that
// it's being shown or hidden.
waterfall.on_hide();
View::on_hide();
}
void PlaylistView::set_parent_rect(const Rect new_parent_rect) {
View::set_parent_rect(new_parent_rect);
const ui::Rect waterfall_rect { 0, header_height, new_parent_rect.width(), new_parent_rect.height() - header_height };
waterfall.set_parent_rect(waterfall_rect);
}
void PlaylistView::on_target_frequency_changed(rf::Frequency f) {
set_target_frequency(f);
}
void PlaylistView::set_target_frequency(const rf::Frequency new_value) {
persistent_memory::set_tuned_frequency(new_value);;
}
rf::Frequency PlaylistView::target_frequency() const {
return persistent_memory::tuned_frequency();
}
} /* namespace ui */
+176
View File
@@ -0,0 +1,176 @@
/*
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2016 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_widget.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "replay_thread.hpp"
#include "ui_spectrum.hpp"
#include <string>
#include <memory>
#include <deque>
namespace ui {
class PlaylistView : public View {
public:
PlaylistView(NavigationView& nav);
~PlaylistView();
void on_hide() override;
void set_parent_rect(const Rect new_parent_rect) override;
void focus() override;
std::string title() const override { return "Playlist"; };
private:
NavigationView& nav_;
static constexpr ui::Dim header_height = 3 * 16;
struct playlist_entry {
rf::Frequency replay_frequency { 0 };
std::string replay_file{};
uint32_t sample_rate{};
uint32_t next_delay{};
};
std::deque<playlist_entry> playlist_db{};
std::deque<playlist_entry> playlist_masterdb{};
uint32_t sample_rate = 0;
int32_t tx_gain { 47 };
bool rf_amp { true }; // aux private var to store temporal, Replay App rf_amp user selection.
static constexpr uint32_t baseband_bandwidth = 2500000;
const size_t read_size { 16384 };
const size_t buffer_count { 3 };
void load_file(std::filesystem::path playlist_path);
void txtline_process(std::string &);
void on_file_changed(std::filesystem::path new_file_path, rf::Frequency replay_frequency, uint32_t replay_sample_rate);
void on_target_frequency_changed(rf::Frequency f);
void on_tx_progress(const uint32_t progress);
void set_target_frequency(const rf::Frequency new_value);
rf::Frequency target_frequency() const;
void toggle();
void start();
void stop(const bool do_loop);
bool is_active() const;
bool loop() const;
void set_ready();
void handle_replay_thread_done(const uint32_t return_code);
void file_error();
std::filesystem::path file_path { };
std::unique_ptr<ReplayThread> replay_thread { };
bool ready_signal { false };
Labels labels {
{ { 10 * 8, 2 * 16 }, "GAIN A:", Color::light_grey() }
};
Button button_open {
{ 0 * 8, 0 * 16, 10 * 8, 2 * 16 },
"Open file"
};
Text text_filename {
{ 11 * 8, 0 * 16, 12 * 8, 16 },
"-"
};
Text text_sample_rate {
{ 24 * 8, 0 * 16, 6 * 8, 16 },
"-"
};
Text text_duration {
{ 11 * 8, 1 * 16, 6 * 8, 16 },
"-"
};
ProgressBar progressbar {
{ 18 * 8, 1 * 16, 12 * 8, 16 }
};
FrequencyField field_frequency {
{ 0 * 8, 2 * 16 },
};
NumberField field_rfgain {
{ 14 * 8, 2 * 16 },
2,
{ 0, 47 },
1,
' '
};
NumberField field_rfamp { // previously I was using "RFAmpField field_rf_amp" but that is general Receiver amp setting.
{ 19 * 8, 2 * 16 },
2,
{ 0, 14 }, // this time we will display GUI , 0 or 14 dBs same as Mic App
14,
' '
};
Checkbox check_loop {
{ 21 * 8, 2 * 16 },
4,
"Loop",
true
};
ImageButton button_play {
{ 28 * 8, 2 * 16, 2 * 8, 1 * 16 },
&bitmap_play,
Color::green(),
Color::black()
};
spectrum::WaterfallWidget waterfall { };
MessageHandlerRegistration message_handler_replay_thread_error {
Message::ID::ReplayThreadDone,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const ReplayThreadDoneMessage*>(p);
this->handle_replay_thread_done(message.return_code);
}
};
MessageHandlerRegistration message_handler_fifo_signal {
Message::ID::RequestSignal,
[this](const Message* const p) {
const auto message = static_cast<const RequestSignalMessage*>(p);
if (message->signal == RequestSignalMessage::Signal::FillRequest) {
this->set_ready();
}
}
};
MessageHandlerRegistration message_handler_tx_progress {
Message::ID::TXProgress,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
this->on_tx_progress(message.progress);
}
};
};
} /* namespace ui */
+16 -1
View File
@@ -23,6 +23,7 @@
#include "ui_pocsag_tx.hpp"
#include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp"
#include "ui_textentry.hpp"
@@ -38,8 +39,13 @@ void POCSAGTXView::focus() {
}
POCSAGTXView::~POCSAGTXView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_pocsag", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void POCSAGTXView::on_tx_progress(const uint32_t progress, const bool done) {
@@ -141,6 +147,15 @@ POCSAGTXView::POCSAGTXView(
&tx_view
});
// load app settings
auto rc = settings.load("tx_pocsag", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
options_bitrate.set_selected_index(1); // 1200bps
options_type.set_selected_index(0); // Address only
@@ -31,6 +31,7 @@
#include "bch_code.hpp"
#include "message.hpp"
#include "transmitter_model.hpp"
#include "app_settings.hpp"
#include "pocsag.hpp"
using namespace pocsag;
@@ -62,6 +63,10 @@ private:
5, 31, 21, 2
};
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
void on_set_text(NavigationView& nav);
void on_tx_progress(const uint32_t progress, const bool done);
bool start_tx();
+16 -6
View File
@@ -24,6 +24,7 @@
#include "portapack.hpp"
#include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "portapack_shared_memory.hpp"
#include <cstring>
@@ -175,8 +176,13 @@ void RDSView::focus() {
}
RDSView::~RDSView() {
// save app settings
app_settings.tx_frequency = transmitter_model.tuning_frequency();
settings.save("tx_rds", &app_settings);
transmitter_model.disable();
baseband::shutdown();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void RDSView::start_tx() {
@@ -226,11 +232,17 @@ RDSView::RDSView(
&view_radiotext,
&view_datetime,
&view_audio,
//&options_countrycode,
//&options_coverage,
&tx_view,
});
// load app settings
auto rc = settings.load("tx_rds", &app_settings);
if(rc == SETTINGS_OK) {
transmitter_model.set_rf_amp(app_settings.tx_amp);
transmitter_model.set_channel_bandwidth(app_settings.channel_bandwidth);
transmitter_model.set_tuning_frequency(app_settings.tx_frequency);
transmitter_model.set_tx_gain(app_settings.tx_gain);
}
check_TP.set_value(true);
sym_pi_code.set_sym(0, 0xF);
@@ -242,8 +254,6 @@ RDSView::RDSView(
};
options_pty.set_selected_index(0); // None
//options_countrycode.set_selected_index(18); // Baguette du fromage
//options_coverage.set_selected_index(0); // Local
tx_view.on_edit_frequency = [this, &nav]() {
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
+7 -2
View File
@@ -24,7 +24,7 @@
#include "ui_transmitter.hpp"
#include "ui_textentry.hpp"
#include "ui_tabview.hpp"
#include "app_settings.hpp"
#include "rds.hpp"
using namespace rds;
@@ -144,12 +144,17 @@ public:
void focus() override;
std::string title() const override { return "RDS transmit"; };
std::string title() const override { return "RDS TX"; };
private:
NavigationView& nav_;
RDS_flags rds_flags { };
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
std::vector<RDSGroup> frame_psn { };
std::vector<RDSGroup> frame_radiotext { };
std::vector<RDSGroup> frame_datetime { };

Some files were not shown because too many files have changed in this diff Show More