Compare commits

...

201 Commits

Author SHA1 Message Date
janek f54870f051 Revert sync at 1000Hz, it is too CPU taxing: #474 2025-05-04 12:09:31 +02:00
janek 329650ad77 cleanup, naming 2025-04-19 18:35:24 +02:00
janek b6a7584509 cleanup 2025-04-19 10:40:02 +02:00
janek 96c3350bbb i2c can have lower GPIO speed 2025-04-13 18:36:41 +02:00
janek 790e049572 Larger USB serial debug output buffer for DEBUG builds 2025-04-10 21:55:57 +02:00
janek 94ab2711d6 Reduce TELEMETRY_OUTPUT_BUFFER_SIZE until needed 2025-04-10 21:51:24 +02:00
janek 43034b5005 Fix and simplify version condition 2025-04-10 21:50:03 +02:00
janek 17aca630ed fixed ext module power circuit image @marco-garcia 2025-04-07 14:40:35 +02:00
janek d22d831a99 move CRS clock init 2025-04-05 17:57:31 +02:00
janek 6cff24d37a updated ext module power circuit image by @marco-garcia 2025-03-27 10:12:43 +01:00
janek 4b8935b039 repo cleanup 2025-03-16 08:38:35 +01:00
Janek e8b26e0613 Update README.md, added license badge 2025-03-16 08:31:54 +01:00
Janek 78501ead38 Update README.md, add gitpod badge 2025-03-16 08:27:57 +01:00
Wilhelm d019ce803b Add gitpod/docker configuration to repo (#469)
* added gitpod/docker
2025-03-16 08:23:58 +01:00
janek 713e06bf6c cleanup, proper name 2025-03-14 22:43:58 +01:00
janek 318141863a Treat 2POS switches as 2 pos (backport) 2025-03-14 21:18:09 +01:00
janek eba65dc5d9 some definitions fixes 2025-03-14 21:15:27 +01:00
janek cee82b9e8b Added ext module power circuit image by @marco-garcia 2025-03-13 18:56:43 +01:00
janek 4a236a2903 version bump 2025-03-09 09:26:12 +01:00
Janek de5ff97919 Update README.md
Increased number of models from 16 to 20.
2025-02-20 22:42:44 +01:00
Janek 187d886648 Increased max models to 20, (#466)
Increased max models to 20,
removed free size counter,
removed legacy eeprom type check
2025-02-20 22:42:00 +01:00
Janek 51ea45dfac Save RAM: Allocate eeFs only for MAX_MODELS (#462)
* allocate eeFs only for MAX_MODELS,
* keep old EEProm alignment
2025-02-18 18:46:51 +01:00
Janek e7edba29f3 Update README.md 2025-02-17 20:40:20 +01:00
janek 31cc42e46a cleanup 2025-02-13 11:37:38 +01:00
janek 713f689996 cleanup 2025-02-02 11:26:31 +01:00
janek 0a893a91c7 added Copy/Paste support to SF and LS. 2025-02-02 10:16:07 +01:00
Janek 51291f0bf1 Fixed issue where returning from popup was blocking UP/DOWN navigation, (#460)
* fixed issue where returning from popup was blocking UP/DOWN navigation,
* added shortcut to go directly to edit mode for empty LS,
* removed POT navigation code,
* more cleanup
2025-02-02 10:11:17 +01:00
janek 95b69c2a0e updated hardware infographics image 2025-01-25 16:12:52 +01:00
janek 41b0e6c17c updated hardware infographics image 2025-01-24 10:45:43 +01:00
janek 0d2f54c2d6 move battery range settings to Radio Hardware tab (EdgeTX/edgetx#5803) 2025-01-23 21:03:36 +01:00
Janek f48d357492 Update channel monitor to reduce size (#454)
* Update channel monitor to reduce size
2025-01-23 17:31:38 +01:00
janek 367700ab81 Removed PPM_UNIT from remaining places 2025-01-23 12:15:46 +01:00
janek 4706422da2 Removed PPM_UNIT from remaining places 2025-01-23 12:12:28 +01:00
Janek 235cf4f7ad Convert PPM_UNIT build option to runtime radio setting (edgetx/edgetx#3993) (#457)
* Convert PPM_UNIT build option to runtime radio setting (edgetx/edgetx#3993)
* DRY to save some space
2025-01-23 11:56:25 +01:00
janek d51977eb68 simplify dfplayer volume setup 2025-01-22 15:16:41 +01:00
janek c9534df0ba Adjust radio setup to match EdgeTX options alignment,
added new gui function overloads
2025-01-22 15:16:41 +01:00
janek b7040cebbe enable 3.75M and 5.25M baudrates 2025-01-22 14:24:04 +01:00
janek f0fcd8ef09 Change "Save all" to "Save settings",
cleanup
2025-01-21 19:47:12 +01:00
janek 8baf62a3f7 version bump to 2.0.0 2025-01-20 22:17:19 +01:00
janek 4a9e891b25 ELRS: increase buffer to support more complex/dual-band devices 2025-01-20 22:15:52 +01:00
janek a919688895 updated trainer PPM timer disabling capture interrupt flag order to match PPM out,
removed comment
2025-01-20 12:37:15 +01:00
janek 5466309bff disable not used condition 2025-01-20 12:37:15 +01:00
janek cf0921b49f merge pulses_arm.h and pulses.h 2025-01-20 12:37:15 +01:00
janek fd7039dd11 cleanup EXTMODULE_TIMER_IRQHandler 2025-01-20 12:37:15 +01:00
janek 3ad862b97c enable PPM timer for in/out mode and disable accordingly, 2025-01-20 12:37:15 +01:00
janek 0ec4be28ef enable PPM timer for in/out mode and disable accordingly, 2025-01-20 12:37:15 +01:00
janek e99e8b4d13 fixed issue with calling afhds2a SPI before setup (blank screen issue),
fixed watchdog issue where isModuleSynchronous was defined wrong,
remove DisablePPMOut,
2025-01-20 12:37:15 +01:00
janek 8e9dd6066e update afhds2a, internal and external module logic,
removed old functions,
removed ahfds2aEnabled flag,
removed pulses_driver.cpp
2025-01-20 12:37:15 +01:00
janek 32418dbe8f remove disable_afhds2a in favor of direct intmoduleStop use 2025-01-20 12:37:15 +01:00
janek b98022f066 Initial pulses refactor commit 2025-01-20 12:37:15 +01:00
janek b7f07b8ba2 Popups fix 2025-01-15 18:34:26 +01:00
janek 77a032effa Merge remote-tracking branch 'origin/master' 2025-01-14 19:26:54 +01:00
Janek efa63ec80d Fix for ELRS 4 arming mode (#453)
* remove not used fixUpModel
* DE arming translation fix
* Fix for ELRS4 arming mode.
Closes #451
2025-01-14 13:55:00 +01:00
janek d02ddfd2c1 DE translation fix 2025-01-03 14:44:15 +01:00
janek 8ffacf0437 remove not used fixUpModel 2025-01-03 14:44:05 +01:00
janek 7bff6c5c10 Simplify ELRS version check 2024-12-28 10:41:42 +01:00
janek 524532e84b elrs update for parameter definitions over 255 bytes 2024-12-24 00:18:56 +01:00
Janek 09d4500482 Popups followup (#450)
* Popups refactoring follow up
2024-12-23 19:47:23 +01:00
janek 0a597df51b buzzer allow higher freq, cleanup 2024-12-23 19:44:53 +01:00
janek 34954190b6 elrs fix for text selection over 255 characters 2024-12-23 19:41:48 +01:00
janek 15b50b0de3 Enable USB_SERIAL for all translations 2024-12-19 18:31:43 +01:00
Janek 3a633cec7f Popups refactor (#449)
* Popups refactor
* Add title to USB modes popup
* cleanup
2024-12-19 18:25:00 +01:00
janek bb3c68b1b4 buzzer, remove not needed ARR register value limit 2024-12-19 11:37:49 +01:00
Janek 41791f34e2 buzzer driver improvements, fix vario, cleanup (#448) 2024-12-19 11:19:39 +01:00
Janek a6430ddb24 Update config.yml
Update docker image to latest to use gcc 14.2
2024-12-17 10:24:14 +01:00
janek 9cacfb0df2 cleanup 2024-12-16 22:15:14 +01:00
Janek 91e8418631 int module init, file renames (#447)
* use proper internal module timer alias from hal.h,
* rename *_arm to generic file names,
* added APB2 SYSCFG define to hal.h, removed from intmoduleAfhds2aStart,
* cleanup of dead code
2024-12-16 20:22:49 +01:00
Janek 3eab877f54 AFHDS2A Fixes (#445)
* fixed custom failsafe channels setup missing for channels > 8,
* fixed checkModelIdUnique on invalid menu line,
* default model internal module off,
* refactored findNextUnusedModelId (opentx#7259)
* remove undocumented long press OK to auto assign next free model ID, reeanable unique ID warn
2024-12-12 13:20:02 +01:00
Janek bec94560d7 Remove not used translations from firmware (#443)
* removed not used translations
* remove DATETIME translation
* exclude VKEYS for non MENU_DIAG_ANAS_KEYS builds
* exclude SLIDERTYPES when NUM_SLIDERS == 0
2024-12-12 13:08:26 +01:00
janek c861ac899e exclude External Module bind 2024-12-11 17:28:55 +01:00
janek 97d9f1c19d enable SBUS_TRAINER back for official builds 2024-12-11 13:22:31 +01:00
janek 70a24b992d rename stream to channel 2024-12-11 12:53:14 +01:00
Janek b6b24dcf94 Update telemetry.cpp
cleanup
2024-12-11 00:50:36 +01:00
janek 14888fdc3a simplify 2024-12-10 21:07:27 +01:00
janek 7f2a5cafd3 Disable IDLE interrupt for telemetry,
cleanup buzzer init,
2024-12-10 21:05:47 +01:00
janek c935e0b5cf cleanup 2024-12-09 22:47:14 +01:00
janek 9bd0397f83 optimize loop iterator type 2024-12-09 22:19:40 +01:00
janek 68195be6d9 crossfireTelemetryPush allow up to full 64 bytes 2024-12-09 12:49:10 +01:00
janek d0bf6310e3 added CMake CROSSFIRE definition 2024-12-08 18:12:57 +01:00
janek b434750207 Merge remote-tracking branch 'origin/master' 2024-12-08 17:54:52 +01:00
janek 5627957dbd update common build options 2024-12-08 17:54:40 +01:00
Janek f7e573fff9 RAM & Flash savings (#444)
* RAM savings: split moduleData structs,
* cleanup not used protocols,
* Flash savings, pxx cleanup
2024-12-08 17:49:57 +01:00
janek 17d3cc2801 add warning 2024-12-08 17:45:48 +01:00
janek 9660f70308 Enable USB Serial for EN on DFPlayer build 2024-12-08 16:12:27 +01:00
Janek 559b2af2e8 Add CRSF Full duplex mode (#442)
* Add CRSF Full duplex mode
* Removed CRSF_UNINVERTED
* correct GPIO AF for RX
2024-12-07 13:56:10 +01:00
janek 24c8653790 cleanup, remove not used telemetryInit modes 2024-12-05 11:26:06 +01:00
janek d976bb0dec do not use EEPROM_VARIANT on PCBI6X 2024-12-05 00:23:58 +01:00
janek 0fde774398 cleanup 2024-12-04 12:52:30 +01:00
janek 60baf50708 Rename Sticks to Axis 2024-12-03 17:35:49 +01:00
janek 0ef6cc2ca8 cleanup 2024-12-03 10:03:34 +01:00
janek 2e1c8dc366 cleanup 2024-12-03 09:52:41 +01:00
janek ef1d6d0b32 Add space to SD edit name (#8405) 2024-12-03 09:50:11 +01:00
janek 33f08f01a4 Move Contrast after Backlight items in Radio Setup 2024-12-03 09:45:11 +01:00
janek 8a0e6f5005 Minor types change to match current OpenTX/EdgeTX 2024-12-03 09:44:24 +01:00
janek 2b4a6ace18 Merge TelemetryProtocols define 2024-12-03 09:42:54 +01:00
janek d97ed48069 Adjust joystick mixer period rate to match usb update rate, added afhds2a period define 2024-11-30 16:24:26 +01:00
janek 76c6c4a7ff typo fix 2024-11-30 11:54:12 +01:00
janek ed930033de Further SKY9X remove 2024-11-30 11:52:34 +01:00
janek 65f2929525 Merge remote-tracking branch 'origin/master' 2024-11-30 11:41:08 +01:00
janek 6a5ec7b803 Further SKY9X remove 2024-11-30 11:40:56 +01:00
Janek ec4da489b3 Added native USB connection detection (#441) 2024-11-30 11:32:32 +01:00
Janek d49cc03892 Update README.md 2024-11-30 00:11:33 +01:00
janek 9eae3f02aa Merge remote-tracking branch 'origin/master' 2024-11-29 23:24:24 +01:00
janek 16e665e05f inav lite typo + size optimization 2024-11-29 23:24:15 +01:00
Janek 900fb616df Update README.md 2024-11-29 10:58:21 +01:00
janek 9af695ed0e FI translation fix 2024-11-28 11:29:44 +01:00
janek a933cc9299 Remove SKY9X target, remove drawFieldLabel 2024-11-24 22:02:18 +01:00
janek 40628f5dca Merge remote-tracking branch 'origin/master' 2024-11-24 21:29:04 +01:00
janek 6c76ebe5ec skip modes when SBUS_TRAINER not defined 2024-11-24 21:28:57 +01:00
Janek a2a9a00774 Elrs optional arming in module setup (#440)
* ELRS optional arming method
2024-11-24 21:27:38 +01:00
janek 4eb8f7310e minor definition fix 2024-11-24 13:58:51 +01:00
Janek 5d1e179e03 Update README.md 2024-11-23 12:14:28 +01:00
Janek 80a2ae5b7d Update README.md 2024-11-23 12:12:25 +01:00
Janek 05a8dc9983 Update README.md 2024-11-23 12:09:58 +01:00
Janek bb47d974f7 Update README.md 2024-11-23 12:08:35 +01:00
Janek 350c18b68e Update README.md 2024-11-23 12:04:13 +01:00
Janek c812a8140a Update README.md 2024-11-23 11:54:25 +01:00
Janek a1d4c9b1cb Update README.md 2024-11-23 11:35:37 +01:00
Janek 1c3a7397bc Update README.md 2024-11-23 10:06:10 +01:00
Janek 0c3ee642cd README.md updated buttons description 2024-11-23 09:58:10 +01:00
Janek 068265a7c1 README.md reorder positions 2024-11-23 09:46:25 +01:00
janek 8daccf079a fix 2024-11-21 13:45:43 +01:00
janek d57a77b103 removed SET Screen function on switches limited i6X 2024-11-21 13:33:42 +01:00
janek d1cb47dd30 enable USB_SERIAL for all HELI builds 2024-11-21 11:30:58 +01:00
janek 7fce538ac1 remove PCBI6X_ prefix from build options 2024-11-21 11:24:37 +01:00
Janek 6752c3c1f6 USB Serial modes (#436)
* USB Serial mode
* USB vid, pid
* shorten USB strings
* single USB mode define, as in EdgeTX
* added CRSF and AFHDS2A USB Telem mirror,
* Reduce CDC_IN_FRAME_INTERVAL since we have smaller buffer and this matches EdgeTX
* fix GCC warnings
2024-11-21 11:11:40 +01:00
Janek baa5ed36f3 added SBUS_TRAINER define to make it build time option (#439)
* added SBUS_TRAINER define to make it build time option
* exclude more, exclude trainer connect/disconnect sounds, make it build time option
2024-11-21 10:56:17 +01:00
Janek 6a5e87c40b Update README.md 2024-11-19 23:13:25 +01:00
Janek ec6d70f198 Update README.md 2024-11-18 17:27:40 +01:00
janek 7994ec402f Revert "remove eeprom version from version screen"
This reverts commit f5180b01df.
2024-11-15 19:30:25 +01:00
janek f5180b01df remove eeprom version from version screen 2024-11-15 19:29:55 +01:00
janek e931b4f212 Combine flags enabling to reduce size 2024-11-14 14:30:04 +01:00
janek 088bdfff11 Reduce DEBUG build size 2024-11-14 14:29:13 +01:00
janek 641ac61119 Match EdgeTX priorities 2024-11-13 00:55:10 +01:00
janek 680a3e3b54 Match Horus driver behaviour. 2024-11-12 20:53:54 +01:00
janek 177a00f1c4 Rewrite DMA init to reduce code size 2024-11-12 14:01:22 +01:00
janek d82393c9cb Remove firmware.txt contents from USB MSD to reduce size 2024-11-12 11:35:15 +01:00
janek 45d3abd883 Fn rename 2024-11-11 02:05:36 +01:00
janek 6aac5b6555 Enable syncing at 1000 Hz 2024-11-11 01:06:01 +01:00
janek d519064f6e size optimization 2024-11-10 16:00:58 +01:00
Janek 13db3d3ef9 Enable Telemetry RX DMA + IDLE interrupt (#437)
* Enabled DMA accelerated telemetry RX
* Additional baud rates in comments
* Cleanup
2024-11-10 15:52:49 +01:00
Janek 315e585353 Update README.md 2024-11-03 14:21:53 +01:00
Janek efabd68aee Update README.md 2024-11-03 14:18:26 +01:00
Janek dd67c8f56c Update README.md 2024-11-03 14:16:19 +01:00
Janek c4347e3e8d Update README.md 2024-11-02 11:50:49 +01:00
Janek 57c8905177 CRSF optional STRING and FLOAT support (#435)
* Add FLOAT support
* increase buffer to accommodate for Param size
* added CRSF_EXTENDED_TYPES guard for STRING and FLOAT support
2024-11-01 20:08:35 +01:00
janek 663e857f54 Readjusted DFPlayer volume levels 2024-11-01 16:56:19 +01:00
janek 39272da5d0 Bump version 2024-11-01 13:46:52 +01:00
janek c698bb0e1e Fixed an issue where DFPlayer was not working in Radio Setup menu and volume was not saved. 2024-11-01 13:40:02 +01:00
janek 3551a8cdbe increase space for option just in case 2024-11-01 13:10:15 +01:00
janek e75fd9b657 optimize for size 2024-11-01 12:44:22 +01:00
janek 4b7a8b03a4 revert 2024-10-31 16:04:07 +01:00
janek e8d6d2a720 optimized for size 2024-10-31 13:43:18 +01:00
janek 529b3e6ed9 simplify condition 2024-10-31 12:56:31 +01:00
janek a7b6614d81 OK button label 2024-10-31 10:49:31 +01:00
janek 36aecef4cf cleanup 2024-10-31 02:07:47 +01:00
janek 7d901ad7a0 Refactored telemetry mirror mode select 2024-10-30 12:59:08 +01:00
janek 3a7312f85d Translations update 2024-10-30 12:09:39 +01:00
janek 023e96b79e Set Screen translations update 2024-10-29 14:01:42 +01:00
janek f14b715b79 DE translation fixes 2024-10-29 13:57:10 +01:00
janek e1e8177aa9 Update CircleCI config 2024-10-29 13:12:39 +01:00
Janek b1c9798365 Fixed popup menus regression (#434) 2024-10-29 12:49:14 +01:00
janek 90f968e2f5 fix(telemetry): wrong scaling after changing unit to rpm (Edgetx/edgetx#4875) 2024-10-23 15:19:18 +02:00
Janek b047c748f2 PCBI6X_USB_MSD exposed as build time option (#432) 2024-10-23 13:26:10 +02:00
janek 98c73ea7bb use paramStringDisplay for INFO 2024-10-22 17:50:17 +02:00
janek e482d3dc03 use paramStringDisplay for INFO 2024-10-22 17:49:24 +02:00
Janek 84d80625f4 ELRS menu: (do not) use maxlen for STRING (#427)
* fix s_editMode state
2024-10-22 17:22:25 +02:00
janek cf3f78e27d More stable batt voltage readings 2024-10-22 11:51:24 +02:00
janek 368d77b446 ELRS menu: increase buffers, fixed initial paramData pointer 2024-10-21 16:43:26 +02:00
janek a025433a3c PL translations 2024-10-21 11:03:38 +02:00
janek 12948100b2 ELRS menu: use s_editMode directly 2024-10-21 02:39:24 +02:00
janek c268229a16 ELRS menu: reuse checkIncDec 2024-10-21 01:51:33 +02:00
janek 9686955ac0 PL translations 2024-10-21 00:55:38 +02:00
janek 6306a89b38 AFHDS2A use local txPacket,
remove global packet pointers,
cleanup
2024-10-21 00:25:51 +02:00
Janek ab51eaa00c AFHDS2A ppm center adjustment (#426)
* AFHDS2A ppm center adjustment
2024-10-20 23:18:01 +02:00
janek d74f533eca By default do not inject AFHDS2A RSSI at ch 17 2024-10-20 19:10:54 +02:00
Janek 3ff3020ba9 ELRS menu: additional data types support (#420)
* support for INT8,UINT16,INT16, STRING
* optimizations for code size
2024-10-20 18:52:05 +02:00
janek 3dffcf7e55 simplify 2024-10-17 00:03:42 +02:00
janek 859b002c49 cosmetics 2024-10-16 23:56:54 +02:00
janek 7c5d6f5a02 elrs cleanup 2024-10-16 14:42:18 +02:00
janek fd5c4711cd elrs cleanup 2024-10-16 14:40:51 +02:00
janek faef96eeaa elrs minor refactor 2024-10-16 14:38:13 +02:00
janek 614c202824 cleanup 2024-10-15 09:53:49 +02:00
janek 8b21998ed4 get back some not used RAM 2024-10-14 22:41:18 +02:00
janek 5cccfe1b68 clean up 2024-10-14 21:14:31 +02:00
janek dfa722036f alignment 2024-10-14 20:07:51 +02:00
janek 2efe7d62f3 elrs fixed popup issue 2024-10-14 17:52:09 +02:00
janek 18c6f98d31 elrs fixes 2024-10-14 16:30:05 +02:00
janek a533acf529 Remove index column from Radio tools 2024-10-12 14:38:51 +02:00
janek e778aec12f Merge remote-tracking branch 'origin/master' 2024-10-12 14:02:10 +02:00
janek ad918726a3 ELRS menu: nicer packet stats alignment, fix paramId reset 2024-10-12 14:01:46 +02:00
janek 68db045da1 ELRS menu: nicer packet stats alignment, fix paramId reset 2024-10-12 14:00:58 +02:00
janek eb118683e8 Unify buttons handling, cleanup 2024-10-12 12:02:53 +02:00
janek 0bcc458ec2 fixed switch midpos delay handling,
allow settings all switches as true 3pos,
cleanup
2024-10-12 00:21:27 +02:00
janek 21dc245974 fixed switch midpos delay handling,
allow settings all switches as true 3pos
2024-10-12 00:20:46 +02:00
janek 30d6006110 cleanup 2024-10-11 15:43:02 +02:00
janek dd919defa6 revert optimized lcdPutPattern 2024-10-11 15:40:08 +02:00
janek 60dca26963 memory layout fix, use board's startup code 2024-10-11 01:26:19 +02:00
janek dd06512823 statistics: removed additional margin 2024-10-10 21:50:05 +02:00
janek 690445c9c0 Optimized lcdPutPattern,
deduplicated draw time code
2024-10-10 21:44:49 +02:00
janek c4c3390465 Cleanup hal.h defines 2024-10-10 18:13:32 +02:00
351 changed files with 3480 additions and 43211 deletions
+10 -5
View File
@@ -5,7 +5,7 @@ version: 2.1
jobs:
build-std:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.3.0
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
@@ -15,7 +15,7 @@ jobs:
build-std-dfplayer:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.3.0
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
@@ -25,7 +25,7 @@ jobs:
build-heli:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.3.0
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
@@ -35,7 +35,7 @@ jobs:
build-heli-dfplayer:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.3.0
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
@@ -45,7 +45,7 @@ jobs:
build-en:
docker:
- image: ajjjjjjjj/opentx-docker-i6x:1.3.0
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
steps:
- checkout
- run: |
@@ -61,23 +61,28 @@ workflows:
branches:
ignore:
- master
- /.*-maintenance/
- build-std:
filters:
branches:
only:
- master
- /.*-maintenance/
- build-std-dfplayer:
filters:
branches:
only:
- master
- /.*-maintenance/
- build-heli:
filters:
branches:
only:
- master
- /.*-maintenance/
- build-heli-dfplayer:
filters:
branches:
only:
- master
- /.*-maintenance/
+7
View File
@@ -0,0 +1,7 @@
# .gitpod.yml
image:
file: Dockerfile
tasks:
- init: echo 'Welcome!'
- command: mkdir build && cd build
+3 -3
View File
@@ -1,7 +1,7 @@
project(OpenTX)
set(VERSION_MAJOR "1")
set(VERSION_MINOR "12")
set(VERSION_MAJOR "2")
set(VERSION_MINOR "1")
set(VERSION_REVISION "0")
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
@@ -43,7 +43,7 @@ today(DATE)
now(TIME)
git_id(GIT_STR)
message(STATUS "OpenTX ${VERSION} @${GIT_STR}")
message(STATUS "OpenI6X ${VERSION} @${GIT_STR}")
# options shared by all targets
+46
View File
@@ -0,0 +1,46 @@
# Dockerfile
FROM archlinux:base
RUN pacman -Syu --noconfirm
# Install misc packages
RUN pacman -S --noconfirm \
7zip \
arm-none-eabi-gcc \
arm-none-eabi-newlib \
base-devel \
bc \
cmake \
cpio \
curl \
dos2unix \
erofs-utils \
git \
less \
nano \
python \
python-pip \
python-pilkit \
screen \
tree \
unzip \
vim \
wget \
zip
# HACK: Allow base-devel to run with root user
RUN sed -i '/E_ROOT/d' /usr/bin/makepkg
# Install yay
RUN git clone https://aur.archlinux.org/yay-bin.git /tmp/yay-bin && \
cd /tmp/yay-bin && \
makepkg -si --noconfirm && \
cd && rm -rf /tmp/yay-bin
#RUN git clone --recursive https://github.com/STMicroelectronics/STM32CubeG0.git /workspace/STM32CubeG0
#RUN git clone --recursive https://github.com/STMicroelectronics/STM32CubeG4.git /workspace/STM32CubeG4
# Personal dir dotfiles
#ADD home /home/
# Personal uploader scripts
#ADD root/bin /usr/local/bin/
+26 -82
View File
@@ -1,104 +1,48 @@
![OpenI6X](https://circleci.com/gh/OpenI6X/opentx.svg?style=shield)
[![Release](https://img.shields.io/github/v/release/OpenI6X/opentx?include_prereleases)](https://github.com/OpenI6X/opentx/releases/latest)
[![GitHub all releases](https://img.shields.io/github/downloads/OpenI6X/opentx/total)](https://github.com/OpenI6X/opentx/releases)
[![GitHub license](https://img.shields.io/github/license/OpenI6X/opentx)](https://github.com/openi6x/opentx/blob/master/LICENSE)
![OpenI6X](https://circleci.com/gh/OpenI6X/opentx.svg?style=shield)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/openi6x/opentx/tree/master)
[![Discord](https://img.shields.io/discord/973289741862727741.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/3vKfYNTVa2)
![Banner](https://github.com/OpenI6X/opentx/blob/master/doc/flysky/banner.png?raw=true)
## Welcome to Openi6X!
# Custom OpenTX / EdgeTX for Flysky FS-i6X
Custom OpenTX/EdgeTX for Flysky FS-i6X.
Join our [Discord](https://discord.gg/3vKfYNTVa2), [RCGroups](https://www.rcgroups.com/forums/showthread.php?3916435-FlySky-I6X-port-of-OpenTX) or [Telegram](https://t.me/otx_flysky_i6x) to contribute, discuss or get help.<br>
Join our [Discord](https://discord.gg/3vKfYNTVa2) or [Telegram](https://t.me/otx_flysky_i6x).<br>
You can find instructions and videos contributed by fellow early adopters in the [RCGroups](https://www.rcgroups.com/forums/showthread.php?3916435-FlySky-I6X-port-of-OpenTX) and [Rakish Rc](https://www.youtube.com/playlist?list=PLfzAEbvn4Bgr3ndNrwp87UimoKVhXkzBa) youtube tutorials.
## Instructions
- [Wiki](https://github.com/OpenI6X/opentx/wiki) - Read before asking for help<br>
- [How to install and upgrade firmware](https://github.com/OpenI6X/opentx/wiki/Flashing-&-Upgrading) <br>
- [Developers guide, how to build](https://github.com/OpenI6X/opentx/wiki/Development) <br>
- [Modifications](https://github.com/OpenI6X/opentx/wiki/Modifications)<br>
- [Features](#features)<br>
- [Navigation](#navigation)<br>
- [Proper shutdown (I see square icon)](#shutdown)<br>
- [USB connection](#usb-connection)<br>
- [Powering by 2S Li-Po/Li-ion/18650](#powering-by-2s-li-poli-ion18650)<br>
- [Mode 1 and Mode 3 radios](#mode-1--mode-3-radios)<br>
- [Credits](#credits)<br>
- [FlySky i6X user interface](https://github.com/OpenI6X/opentx/wiki/Manual) and other differences to official EdgeTX/OpenTX devices.<br>
- [EdgeTX manual](https://manual.edgetx.org/bw-radios)
- [How to install, upgrade or restore firmware](https://github.com/OpenI6X/opentx/wiki/Flashing-&-Upgrading)<br>
- [Developers guide, how to build](https://github.com/OpenI6X/opentx/wiki/Development)<br>
- [Modifications](https://github.com/OpenI6X/opentx/wiki/Modifications)<br>
## Comparison
## Features
Comparison with original firmware:
| Feature | FlySky i6X | OpenTX i6X |
| Feature | FlySky i6X | OpenI6X |
|---------------------------|------------|------------------------------|
| Channels | 6/10 | 16 |
| Mixers | 3 | 32 |
| Models | 20 | 16 / unlimited<sup>[1]</sup> |
| Protocols | AFHDS, AFHDS2A, PPM | AFHDS2A, PPM, CRSF |
| Trainer | PPM | SBUS, PPM |
| Logical switches | _ | ✓ |
| Global variables | _ | ✓ |
| Models | 20 | 20 / unlimited<sup>[1]</sup> |
| Protocols | AFHDS, AFHDS2A, PPM | AFHDS2A + 16Ch modes, PPM, CRSF |
| Trainer | PPM | PPM, SBUS |
| Timers | _ | ✓ |
| Voice annoucements | _ | ✓<sup>[2]</sup> |
| Use trims as buttons | _ | ✓ |
| ExpressLRS ready | _ | ✓ |
| Telemetry mirror | _ | ✓ |
| Languages | EN,CN | PL,EN,CZ,DE,ES,FI,FR,IT,NL,PT,SE |
| Variometer | _ | ✓ |
| ExpressLRS ready | _ | ✓ Configurator built-in (no need for LUA) |
| Adjustable screen brightness | _ | ✓<sup>[3]</sup> |
| USB Modes | Joystick | Joystick, Storage, Serial (Telemetry mirror, Debug) |
| AUX Serial port | _ | ✓ SBUS Trainer, Telemetry mirror, Debug |
| FlySky FS-HZCZ03-ADJ Gimbal support | _ | ✓<sup>[4]</sup> |
| Languages | EN, CN | PL, EN, CZ, DE, ES, FI, FR, IT, NL, PT, SE |
<sub>[1] Unlimited by using USB mass storage mode eeprom backup/restore.</sub><br>
<sub>[2] By adding DFPlayer, see modifications in wiki.</sub>
* Protocols:
* AFHDS2A with SBUS, IBUS and extended SBUS16, IBUS16 - 16 channels modes
* PPM in/out
* CRSF with ExpressLRS and Crossfire modules:
* CRSFshot
* MEGA Bauds up to 1.8M
* ExpressLRS V3 configuration built-in (no need to copy ELRSV3.lua)
* Telemetry
* Adjustable backlight brightness level
* Audio tones, alarms and Vario sound custom implementation
* Voice annoucements
* DFU bootloader - Start by pushing horizontal trims to the center, like regular OpenTX one
* USB Joystick & Storage modes
* AUX Serial port with modes:
* Telemetry mirror for AFHDS2A and CRSF
* SBUS Trainer
* Debug (on DEBUG builds)
* FlySky FS-HZCZ03-ADJ Digital Gimbal support
<sub>[2] By adding DFPlayer, see [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#dfplayer) in wiki.</sub><br>
<sub>[3] By wiring 2 pads, see [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#adjustable-backlight-level) in wiki.</sub><br>
<sub>[4] See [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#flysky-fs-hzcz03-adj-gimbal) in wiki.</sub>
## Navigation
| Key | Function |
| --- |----------------------------------------------------------------------------------------------------|
| UP | Up. Scroll values. Hold on main screen for stats. |
| DOWN | Down. Scroll values. Hold on main screen for telemetry. |
| OK | Confirm. Hold on main screen for model menu. Short press on main screen for popup menu. |
| CANCEL | Exit/Back/Cancel. |
| BIND | Scroll pages right or left (long press), go right in a line. Hold on main screen for general menu. |
## Shutdown
FlySky FS-i6X don't have a software controlled shutdown button. Do not switch off radio when you see `▫` (small square) icon in top right corner of main screen. It indicates that settings are not yet saved. Wait until it disappears or use "Save all" option from main screen popup menu.
When to use "Save all" option:
* When you don't want to wait until square icon disappear before shutdown.
* With USB connected - when USB is connected then settings are not stored with standard delay.
* To save timers.
## USB connection
FlySky FS-i6X don't have a USB VBUS making it impossible to detect USB connection. To connect press OK on main screen and select "USB Connect" (In version 1.8.0 or earlier it's in: Radio Setup -> "USB Detect").<br>
Automatic connection detection can be added by wiring `PA15` pad to USB VBUS preferably with a resistor (I have used 1K).
## Powering by 2S Li-Po/Li-ion/18650
FlySky i6X is officially rated for up to 6V. Running anything above may damage your radio.
## Mode 1 & Mode 3 radios
With Mode 1 & Mode 3 radios you may experience inverted gimbal movement and swapped gimbals on main screen. To fix this swap gimbal connectors (red-white one with black-white one).
## Credits
* Janek ([ajjjjjjjj](https://github.com/ajjjjjjjj)), continues Kuba's and Mariano's work, added sound, USB, ExpressLRS V2/V3 configuration, telemetry mirror, SBUS trainer, new/fixed drivers, ports, bugfixes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 174 KiB

-1
View File
@@ -1 +0,0 @@
/settings.sh
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
set -e
set -x
# in this file define ssh options (like private key)
source ~/.opentx-jenkins-settings
function download() {
# $1 is release directory name
mkdir -p ${1}
scp ${SCP_OPT} ${USERNAME}@jenkins.open-tx.org:/home/opentx/${1}/*.sh ${1}/
#chmod 774 ${1}/*.sh
}
download release-20
download nightly-21
download release-21
download nightly-22
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
source ./version.sh
# release all components
./release-companion.sh
./release-firmware.sh
-41
View File
@@ -1,41 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
# pull the latest changes
./update-repo.sh
# retrieve release after the repo update
source ./version.sh
DESTDIR=/var/www/html/downloads-${version}/nightly/companion
# clean radio source
cd opentx/radio/src
make clean
# create companion rpm
rm -rf ${DIR}/companion-build/
mkdir -p ${DIR}/companion-build/
cd ${DIR}/companion-build/
cmake ../opentx/companion/src
make package
cp ./companion${version}-${release}${OPENTX_VERSION_SUFFIX}-i686.rpm ${DESTDIR}
make stamp
chmod -Rf g+w . || true
# request companion compilation on Windows
cd ${DESTDIR}
wget -qO- http://winbox.open-tx.org/companion-builds/compile21.php?branch=${branch}\&suffix=${OPENTX_VERSION_SUFFIX}
wget -O companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe
mv ${DIR}/opentx/companion/companion.stamp ./companion-windows.stamp
chmod -Rf g+w . || true
-46
View File
@@ -1,46 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
# pull the latest changes
./update-repo.sh
# retrieve release after the repo update
source ./version.sh
# make the stamp
cd opentx/radio/src
make clean
make opentx-stamp
# create the sources tgz in the release directory
cd ../../..
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
# make lua fields for all radio variants
cd opentx/radio/src
make lua_exports_taranis.inc lua_exports_taranis_x9e.inc
DESTDIR=/var/www/html/downloads-${version}/nightly/firmware
# copy the stamp and the release-notes to the http server
cd ${DIR}
cp opentx/radio/src/stamp-opentx.txt ${DESTDIR}
cp opentx/radio/releasenotes.txt ${DESTDIR}
cp opentx/radio/src/lua_fields_*.txt ${DESTDIR}
echo ${OPENTX_VERSION_SUFFIX} > ${DESTDIR}/suffix.txt
# erase all previous builds
rm -f ${DESTDIR}/binaries/opentx*.hex
rm -f ${DESTDIR}/binaries/opentx*.bin
# clean the sources
cd opentx/radio/src
make clean
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR
source ./version.sh
# pull the latest changes
cd opentx
git fetch
git checkout $branch
git reset --hard origin/$branch
chmod -Rf g+w . || true
-12
View File
@@ -1,12 +0,0 @@
#!/bin/bash
# make stamp header and extract OpenTX version (ie 2.1.2)
make -C opentx/radio/src stamp_header
rel=`grep "VERS_STR" opentx/radio/src/stamp-opentx.h | cut -d' ' -f3 | tr -d '"'`
release=${rel%$OPENTX_VERSION_SUFFIX}
echo ${release}
version=21
branch=master
winboxurl=http://winbox.open-tx.org/voice-builds
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
source ./version.sh
# release all components
./release-companion.sh
./release-firmware.sh
-40
View File
@@ -1,40 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
# pull the latest changes
./update-repo.sh
# retrieve release after the repo update
source ./version.sh
DESTDIR=/var/www/html/downloads-${version}/nightlies/companion
# clean radio source
cd opentx/radio/src
make clean
# create companion rpm
rm -rf ${DIR}/companion-build/
mkdir -p $_
cd $_
cmake -DPCB=TARANIS ../opentx
make package
cp ./companion${version}-${release}${OPENTX_VERSION_SUFFIX}-i686.rpm ${DESTDIR}/linux
chmod -Rf g+w ${DESTDIR}/linux/companion${version}-${release}${OPENTX_VERSION_SUFFIX}-i686.rpm
# request companion compilation on Windows
cd ${DESTDIR}
wget -qO- http://winbox.open-tx.org/companion-builds/compile22.php?branch=${branch}\&suffix=${OPENTX_VERSION_SUFFIX}
wget -O windows/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe
chmod -Rf g+w windows/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe
# update windows stamp
cp $DIR/companion-build/version.h ./companion-windows.stamp
chmod -Rf g+w ./companion-windows.stamp
-45
View File
@@ -1,45 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
# pull the latest changes
./update-repo.sh
# retrieve release after the repo update
source ./version.sh
# make the stamp
cd opentx/radio/src
make clean
make stamp.h
# create the sources tgz in the release directory
cd ../../..
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
# make lua fields for all radio variants
cd opentx/radio/src
make lua/lua_exports_taranis.inc lua/lua_exports_taranis_x9e.inc lua/lua_exports_horus.inc
DESTDIR=/var/www/html/downloads-${version}/nightlies/firmware
# copy the stamp and the release-notes to the http server
cd $DIR
cp opentx/radio/src/stamp.h ${DESTDIR}/stamp-opentx.txt
cp opentx/radio/releasenotes.txt ${DESTDIR}
cp opentx/radio/src/lua/lua_fields_*.txt ${DESTDIR}
echo ${OPENTX_VERSION_SUFFIX} > ${DESTDIR}/suffix.txt
# erase all previous builds
rm -f ${DESTDIR}/binaries/opentx*.hex
rm -f ${DESTDIR}/binaries/opentx*.bin
# clean the sources
cd opentx/radio/src
make clean
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR
source ./version.sh
# pull the latest changes
cd opentx
git fetch
git checkout $branch
git reset --hard origin/$branch
chmod -Rf g+w . || true
-12
View File
@@ -1,12 +0,0 @@
#!/bin/bash
# make stamp header and extract OpenTX version (ie 2.1.2)
make -C opentx/radio/src stamp.h
rel=`grep "VERSION" opentx/radio/src/stamp.h | cut -d' ' -f3 | tr -d '"'`
release=${rel%$OPENTX_VERSION_SUFFIX}
echo ${release}
version=22
branch=next
winboxurl=http://winbox.open-tx.org/voice-builds
-14
View File
@@ -1,14 +0,0 @@
#!/bin/bash
# stops on first error
set -e
# make sure we are in the good directory
cd ~opentx/release-20/
# release all components
./release-companion.sh
#./release-voices.sh
#./release-lua.sh
./release-firmware.sh
-35
View File
@@ -1,35 +0,0 @@
#!/bin/bash
# stops on first error
set -e
# make sure we are in the good directory
cd ~opentx/release-20/
# pull the latest changes
./update-repo.sh
# retrieve the version number
cd opentx/radio/src
line=`grep "VERSION = " Makefile`
version=`expr "$line" : 'VERSION = \([0-9]\..*\)'`
# create companion rpm
rm -rf ~opentx/release-20/companion-build/
mkdir -p $_
cd $_
cmake ../opentx/companion/src
make package
cp ./companion-$version-i686.rpm /var/www/html/downloads-20/companion/
make stamp
chmod -Rf g+w . || true
# request companion compilation on Windows
cd /var/www/html/downloads-20/companion/
wget -qO- http://winbox.open-tx.org/companion-builds/compile20.php?branch=2.0
wget -O companionInstall_$version.exe http://winbox.open-tx.org/companion-builds/companionInstall_$version.exe
mv ~opentx/release-20/opentx/companion/companion.stamp ./companion-windows.stamp
chmod -Rf g+w . || true
-35
View File
@@ -1,35 +0,0 @@
#!/bin/bash
# stops on first error
set -e
# make sure we are in the good directory
cd ~opentx/release-20/
# pull the latest changes
./update-repo.sh
# make the stamp
cd opentx/radio/src
make clean
make opentx-stamp
make lua_exports.cpp
# create the sources tgz in the release directory
cd ../../..
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
# copy the stamp and the release-notes to the http server
cd ~opentx/release-20/
cp opentx/radio/src/stamp-opentx.txt /var/www/html/downloads-20/firmware/
cp opentx/radio/releasenotes.txt /var/www/html/downloads-20/firmware/
cp opentx/radio/src/lua_fields.txt /var/www/html/downloads-20/firmware/
# erase all previous builds
rm -f /var/www/html/downloads-20/firmware/binaries/opentx*.hex
rm -f /var/www/html/downloads-20/firmware/binaries/opentx*.bin
# clean the sources
cd opentx/radio/src
make clean
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
# stops on first error
set -e
# make sure we are in the good directory
cd ~opentx/release-20/
# pull the latest changes
./update-repo.sh
# make the stamp
cd opentx/radio/wizard/
zip -r /var/www/html/lua-20/wizard.zip *.lua *.bmp
-17
View File
@@ -1,17 +0,0 @@
#!/bin/bash
# stops on first error
set -e
# get voice packs
wget -O /dev/null http://winbox.open-tx.org/voice-packs/compile.php
cd /var/www/html/voices-20/opentx-taranis/en/
wget -O english-irish-taranis.zip http://winbox.open-tx.org/voice-packs/english-irish-taranis.zip
wget -O english-scottish-taranis.zip http://winbox.open-tx.org/voice-packs/english-scottish-taranis.zip
wget -O english-american-taranis.zip http://winbox.open-tx.org/voice-packs/english-american-taranis.zip
wget -O english-australian-taranis.zip http://winbox.open-tx.org/voice-packs/english-australian-taranis.zip
# wget -O english-taranis.csv http://winbox.open-tx.org/voice-packs/english-irish-taranis.csv
cd /var/www/html/voices-20/opentx-taranis/fr/
wget -O french-taranis.zip http://winbox.open-tx.org/voice-packs/french-taranis.zip
# wget -O french-taranis.csv http://winbox.open-tx.org/voice-packs/french-taranis.csv
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
# stops on first error
set -e
# make sure we are in the good directory
cd ~opentx/release-20/
# pull the latest changes
cd opentx
git fetch
git checkout 2.0
git reset --hard origin/2.0
chmod -Rf g+w . || true
-17
View File
@@ -1,17 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
source ./version.sh
# release all components
./release-companion.sh
./release-voices.sh
./release-lua.sh
./release-firmware.sh
-40
View File
@@ -1,40 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
# pull the latest changes
./update-repo.sh
# retrieve release after the repo update
source ./version.sh
DESTDIR=/var/www/html/downloads-${version}/companion
# clean radio source
cd opentx/radio/src
make clean
# create companion rpm
rm -rf ${DIR}/companion-build/
mkdir -p ${DIR}/companion-build/
cd ${DIR}/companion-build/
cmake ../opentx/companion/src
make package
cp ./companion${version}-${release}-i686.rpm ${DESTDIR}
make stamp
chmod -Rf g+w . || true
# request companion compilation on Windows
cd ${DESTDIR}
wget -qO- http://winbox.open-tx.org/companion-builds/compile21.php?branch=${branch}
wget -O companion-windows-${release}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${release}.exe
mv ${DIR}/opentx/companion/companion.stamp ./companion-windows.stamp
chmod -Rf g+w . || true
-45
View File
@@ -1,45 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR
# pull the latest changes
./update-repo.sh
# retrieve release after the repo update
source ./version.sh
# make the stamp
cd opentx/radio/src
make clean
make opentx-stamp
# create the sources tgz in the release directory
cd ../../..
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
# make lua fields for all radio variants
cd opentx/radio/src
make lua_exports_taranis.inc lua_exports_taranis_x9e.inc
DESTDIR=/var/www/html/downloads-${version}/firmware
# copy the stamp and the release-notes to the http server
cd ${DIR}
cp opentx/radio/src/stamp-opentx.txt ${DESTDIR}
cp opentx/radio/releasenotes.txt ${DESTDIR}
cp opentx/radio/src/lua_fields_*.txt ${DESTDIR}
# erase all previous builds
rm -f ${DESTDIR}/binaries/opentx*.hex
rm -f ${DESTDIR}/binaries/opentx*.bin
# clean the sources
cd opentx/radio/src
make clean
-20
View File
@@ -1,20 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
# pull the latest changes
./update-repo.sh
# retrieve release after the repo update
source ./version.sh
# release wizard
cd opentx/radio/wizard/
zip -r /var/www/html/lua-${version}/wizard.zip *.lua *.bmp
-27
View File
@@ -1,27 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd ${DIR}
# retrieve release after the repo update
source ./version.sh
# build voice packs
wget -O /dev/null ${winboxurl}/compile.php?branch=${branch}
# get voice packs
cd /var/www/html/voices-${version}/opentx-taranis/en/
wget -O english-irish-taranis.zip ${winboxurl}/english-irish-taranis.zip
wget -O english-scottish-taranis.zip ${winboxurl}/english-scottish-taranis.zip
wget -O english-american-taranis.zip ${winboxurl}/english-american-taranis.zip
wget -O english-australian-taranis.zip ${winboxurl}/english-australian-taranis.zip
# wget -O english-taranis.csv ${winboxurl}/english-irish-taranis.csv # doesn't seem to work
cd /var/www/html/voices-${version}/opentx-taranis/fr/
wget -O french-taranis.zip ${winboxurl}/french-taranis.zip
# wget -O french-taranis.csv ${winboxurl}/french-taranis.csv #outdated
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
# stops on first error
set -e
set -x
# make sure we are in the good directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR
source ./version.sh
# pull the latest changes
cd opentx
git fetch
git checkout $branch
git reset --hard origin/$branch
chmod -Rf g+w . || true
-12
View File
@@ -1,12 +0,0 @@
#!/bin/bash
# make stamp header and extract OpenTX version (ie 2.1.2)
make -C opentx/radio/src stamp_header
rel=`grep "VERS_STR" opentx/radio/src/stamp-opentx.h | cut -d' ' -f3 | tr -d '"'`
release=${rel%$OPENTX_VERSION_SUFFIX}
echo ${release}
version=21
branch=master
winboxurl=http://winbox.open-tx.org/voice-builds
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
set -e
set -x
# in this file define ssh options (like private key)
source ~/.opentx-jenkins-settings
function upload() {
# $1 is release directory name
# copy scripts to server
scp ${SCP_OPT} ${1}/*.sh ${USERNAME}@jenkins.open-tx.org:/home/opentx/${1}/
}
upload release-20
upload nightly-21
upload release-21
upload nightly-22
-12
View File
@@ -1,12 +0,0 @@
opentx-companion22 (2.2.1~ppa01~artful) artful; urgency=low
* New release 2.2.1~ppa01
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:37 +0100
opentx-companion22 (2.2.1~N432+test01~artful) artful; urgency=low
* New release 2.2.1~N432+test01
-- projectkk2glider <projectkk2glider@gmail.com> Fri, 10 Nov 2017 18:36:11 +0100
-6
View File
@@ -1,6 +0,0 @@
opentx-companion22 (2.2.1~ppa01~bionic) bionic; urgency=low
* New release 2.2.1~ppa01
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:37 +0100
-1
View File
@@ -1 +0,0 @@
/suffix
-21
View File
@@ -1,21 +0,0 @@
Source: opentx-companion22
Section: utils
Priority: optional
Maintainer: projectkk2glider <projectkk2glider@gmail.com>
Build-Depends: cmake,
build-essential,
python,
python-qt4,
qt5-default,
qttools5-dev-tools,
qtmultimedia5-dev,
qttools5-dev,
libsdl1.2-dev,
libqt5svg5-dev
Homepage: http://www.open-tx.org/
Package: opentx-companion22
Architecture: any
Depends: ${shlibs:Depends}, libqt5multimedia5-plugins
Description: OpenTX Companion
Models and settings editor for the OpenTX open source firmware
-339
View File
@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
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.
<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
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.
-51
View File
@@ -1,51 +0,0 @@
#!/usr/bin/make -f
BUILDDIR = build_dir
COMMON_OPTIONS = -DCMAKE_INSTALL_PREFIX=../debian/tmp/usr \
-DSIMULATOR_INSTALL_PREFIX=/usr \
-DFIRMWARE_TARGET=NO \
-DGVARS=YES \
-DHELI=YES \
-DALLOW_NIGHTLY_BUILDS=NO \
-DVERSION_SUFFIX=__VERSION_SUFFIX__
STM32_OPTIONS = -DLUA=YES
# secondly called by launchpad
build:
mkdir $(BUILDDIR);
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=9X ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=GRUVIN9X ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=MEGA2560 ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=SKY9X ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=9XRPRO ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X7 ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X9D ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X9D+ ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X9E ../ ; make libsimulator
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X12S ../ ; make libsimulator
make -C $(BUILDDIR) companion22 simulator22
# thirdly called by launchpad
binary: binary-indep binary-arch
binary-indep:
# nothing to be done
binary-arch:
# final cmake neede in order to find all simulators
cd $(BUILDDIR); cmake ../
cd $(BUILDDIR); cmake -P cmake_install.cmake
mkdir debian/tmp/DEBIAN
dpkg-shlibdeps debian/tmp/usr/bin/companion22 debian/tmp/usr/bin/simulator22 debian/tmp/usr/lib/companion22/*
dpkg-gencontrol -popentx-companion22
dpkg --build debian/tmp ..
# firstly called by launchpad
clean:
rm -rf $(BUILDDIR)
.PHONY: binary binary-arch binary-indep clean
-72
View File
@@ -1,72 +0,0 @@
#!/bin/sh
set -e
set -x
# $1 is distribution "trusty" OR "yakkety"
#
# Option "-n" or "--nightly" can be used to configure build script to produce a Companion with DALLOW_NIGHTLY_BUILDS=YES flag
cd `dirname ${0}`
nightly_build=0
while [ $# -gt 0 ]
do
case "$1" in
--nightly*)
nightly_build=1;;
-n*)
nightly_build=1;;
-*)
echo >&2 "usage: $0 [-n|--nightly] DISTRO"
exit 1;;
*)
break;; # terminate while loop
esac
shift
done
distro=${1%/}
. common/suffix
if [ -z ${distro} ] ; then
echo "Missing distribution name"
exit 1
fi
if [ ! -d ${distro} ] ; then
echo "Files for ${distro} not found. Most likely unsupported distribution. Aborting..."
exit 1
fi
echo "Preparing sources for ${distro}..."
# prepare debian directory
rm -f ../debian/*
mkdir -p ../debian/
cp common/* ../debian/
cp ${distro}/* ../debian/
if [ ${nightly_build} -gt 0 ] ; then
echo "Editing rules to set version suffix to \"${suffix}\""
sed -i "s/__VERSION_SUFFIX__/${suffix}/g" ../debian/rules
echo "Setting nightly build flag"
sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=YES/g" ../debian/rules
else
sed -i "s/__VERSION_SUFFIX__//g" ../debian/rules
sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=NO/g" ../debian/rules
fi
# remove old package and prepare new one
cd ..
rm -f ../opentx-companion22_*${distro}*
debuild -S -sa -I -Ijenkins -Ilaunchpad -Idoc -Ibuild -I*.luac
echo "Use this command to upload to launchpad (nightly builds):"
echo " dput ppa:opentx-test/ppa opentx-companion22_<version>.changes"
echo "OR releases:"
echo " dput ppa:opentx-test/rel opentx-companion22_<version>.changes"
-108
View File
@@ -1,108 +0,0 @@
# Launchpad instructions
## General description
This directory contains files and scripts that help to prepare the files needed by the Launchpad.net server to build the Debian packages of OpentX Companion for Ubuntu.
Each supported release of Ubuntu has its own sub-directory, but most of the files reside in the common directory. When preparing a source for certain Ubuntu release always use its the directory name.
There are several step to release a new version of Companion on Launchpad:
* update the Debian changelog
* package the source
* upload the source to Launchpad
The steps above should be repeated for every Ubuntu release. The example below will work with Ubuntu `trusty`
## Prerequisites
* you must have launchpad.net account and be a member of the team
* create and configure your GPG signing key
## Prepare your GPG key
Create GPG key using **name** and **email* that will later appear in the changelog. This will be the key
that will be used to sign the package before uploading it to Launchpad.
```
gpg --gen-key
```
Upload your GPG key (public part) to the Ubuntu key-server. First get the KEY ID (8 characters) of your key:
```
gpg --list-keys
```
Then upload it (replace <KEY ID> with your key ID):
```
gpg --send-keys --keyserver keyserver.ubuntu.com <KEY ID>
```
## Create a Launchpad account
* Go to https://launchpad.net/ and sign-in or register.
* Associate your GPG key with your launchpad account. You will need your keys fingerprint (<fingerprint looks like E448 37D6 EF6E F13C 30C0 415C E7A0 818F 4864 9459>), get it with:
```
gpg --fingerprint
```
* Join OpenTX team on launchpad (one of admins will add you to the team).
## Step 1: update the Debian changelog
You can edit changelog manually, but it is simpler to use a script that creates a generic entry in the changelog. You can always edit it later if needed.
The script is `update-changelog.sh` and it takes 4 parameters:
* email address in the form of `name <email@address>`, since it contains a space it must be enclosed in quotation marks. The email addres must be the same as the one in your GPG key!
* Ubuntu release (directory name)
* OpenTX version
* OpenTX sub-version (Nxxx for nightly builds)
Example:
```
cd opentx/launchpad
./update-changelog.sh "projectkk2glider <projectkk2glider@gmail.com>" trusty 2.2.0 N363
```
If there is an error and you need to build another version of the same OpenTX release, then just add `.n` to the sub-version like so:
```
N363.1
N363.2
etc
```
The script will append new section to the existing file in this case `trusty/changelog`. Now you have a chance to edit the file manually if needed.
## Step 2: prepare files for upload (package the source)
First make sure you don't have any files that you don't want included in the opentx directory. Then use the script `prepare.sh` with the name of release as the first parameter:
```
cd opentx/launchpad
./prepare.sh trusty
```
The result of this script are three files which are placed outside the OpenTX source tree at the same level as `opentx` directory:
```
ls -1 ../../opentx-companion22_2.2.0~N363*
../../opentx-companion22_2.2.0~N363~trusty.dsc
../../opentx-companion22_2.2.0~N363~trusty_source.build
../../opentx-companion22_2.2.0~N363~trusty_source.changes
../../opentx-companion22_2.2.0~N363~trusty.tar.gz
```
You should now make sure that the just build source archive `opentx-companion22_2.2.0~N363~trusty.tar.gz` does not contain any files or directories that you don;t want to share with the world, because this is one of the files that will be uploaded to the Launchpad server. Currently clean OpenTX tree produces this file with approximate size of 16.8MB.
## Upload the source to the Launchpad
Last step it to upload the new release to the Launchpad server and wait for it to be built. Use `dput` command with two arguments:
* name of the PPA `ppa:opentx-test/ppa` (your public key must be associated with that PPA)
* name of the release file `<dsfsfggg>.changes`
Upload to nightly PPA:
```
dput ppa:opentx-test/ppa ../../opentx-companion22_2.2.0~N363~trusty_source.changes
```
Upload to release PPA:
```
dput ppa:opentx-test/rel ../../opentx-companion22_2.2.0~N363~trusty_source.changes
```
-41
View File
@@ -1,41 +0,0 @@
#!/bin/sh
set -e
set -x
# $1 is changelog user and email, example "projectkk2glider <projectkk2glider@gmail.com>"
# $2 is distribution "trusty" OR "yakkety"
# $3 is version, example "2.2.1"
# $4 is suffix (optional, used for nightly builds, example "N360")
email=${1}
distro=${2%/}
version=${3}
suffix=${4}
echo "Updating changelog for ${distro}"
cd `dirname ${0}`
[ -z ${distro} ] && echo "Missing distribution name" && exit 1;
[ ! -z ${suffix} ] && version=${version}~${suffix}
if [ ! -d ${distro} ] ; then
echo "${distro} changelog not found. Most likely unsupported distribution. Aborting..."
exit 1
fi
echo "opentx-companion22 (${version}~${distro}) ${distro}; urgency=low" > tmp-changelog
echo "" >> tmp-changelog
echo " * New release ${version}" >> tmp-changelog
echo "" >> tmp-changelog
echo " -- ${email} "`date -R` >> tmp-changelog
echo "" >> tmp-changelog
cat tmp-changelog ${distro}/changelog > new-changelog
mv new-changelog ${distro}/changelog
rm tmp-changelog
echo "suffix=${suffix}" > common/suffix
echo "Result:"
cat ${distro}/changelog | head -n 20
-23
View File
@@ -1,23 +0,0 @@
opentx-companion22 (2.2.1~ppa01~xenial) xenial; urgency=low
* New release 2.2.1~ppa01
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:44 +0100
opentx-companion22 (2.2.1~N432+test01~xenial) xenial; urgency=low
* New release 2.2.1~N432+test01
-- projectkk2glider <projectkk2glider@gmail.com> Fri, 10 Nov 2017 18:55:08 +0100
opentx-companion22 (2.2.0~ppa02~xenial) xenial; urgency=low
* New release 2.2.0~ppa02
-- projectkk2glider <projectkk2glider@gmail.com> Wed, 31 May 2017 22:37:54 +0200
opentx-companion22 (2.2.0~ppa01~xenial) xenial; urgency=low
* OpenTX version 2.2.0
-- projectkk2glider <projectkk2glider@gmail.com> Wed, 31 May 2017 21:50:57 +0200
-12
View File
@@ -1,12 +0,0 @@
opentx-companion22 (2.2.1~ppa01~zesty) zesty; urgency=low
* New release 2.2.1~ppa01
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:48 +0100
opentx-companion22 (2.2.1~N432+test01~zesty) zesty; urgency=low
* New release 2.2.1~N432+test01
-- projectkk2glider <projectkk2glider@gmail.com> Fri, 10 Nov 2017 18:37:33 +0100
+5 -20
View File
@@ -12,8 +12,6 @@ set(TRANSLATIONS "EN" CACHE STRING "Radio language, one of: ${GUI_LANGUAGES}")
set_property(CACHE TRANSLATIONS PROPERTY STRINGS ${GUI_LANGUAGES})
set(SPLASH "DEFAULT" CACHE STRING "Splash (DEFAULT/OFF/FRSKY)")
set_property(CACHE SPLASH PROPERTY STRINGS DEFAULT OFF FRSKY)
set(PPM_UNIT "PERCENT_PREC1" CACHE STRING "PPM display unit (US/PERCENT_PREC1/PERCENT_PREC0)")
set_property(CACHE PPM_UNIT PROPERTY STRINGS US PERCENT_PREC1 PERCENT_PREC0)
set(DEFAULT_MODE "" CACHE STRING "Default sticks mode")
set(FONT "STD" CACHE STRING "Choose font : STD or SQT5")
set_property(CACHE FONT PROPERTY STRINGS SQT5)
@@ -49,9 +47,8 @@ option(FRSKY_STICKS "Reverse sticks for FrSky sticks" OFF)
option(NANO "Use nano newlib and binalloc")
option(NIGHTLY_BUILD_WARNING "Warn this is a nightly build" OFF)
option(MODULE_R9M_FLEX_FW "Add R9M options for non certified firmwwares" OFF)
option(PXX2 "Enable PXX v2 support" OFF)
option(CRSF_UNINVERTED "Enable uninverted CRSF" OFF)
option(EXTPWR_INVERT "Enable inverted pwr enable on PC13" OFF)
option(CRSF_FULLDUPLEX "Enable CRSF full duplex mode with RX on PA15" OFF)
# since we reset all default CMAKE compiler flags for firmware builds, provide an alternate way for user to specify additional flags.
set(FIRMWARE_C_FLAGS "" CACHE STRING "Additional flags for firmware target c compiler (note: all CMAKE_C_FLAGS[_*] are ignored for firmware/bootloader).")
@@ -275,14 +272,6 @@ if(SHUTDOWN_CONFIRMATION)
add_definitions(-DSHUTDOWN_CONFIRMATION)
endif()
if(PPM_UNIT STREQUAL US)
add_definitions(-DPPM_UNIT_US)
elseif(PPM_UNIT STREQUAL PERCENT_PREC1)
add_definitions(-DPPM_UNIT_PERCENT_PREC1)
else()
add_definitions(-DPPM_UNIT_PERCENT_PREC0)
endif()
if(PPM_CENTER_ADJUSTABLE)
add_definitions(-DPPM_CENTER_ADJUSTABLE)
endif()
@@ -337,18 +326,14 @@ if(MODULE_R9M_FLEX_FW)
add_definitions(-DMODULE_R9M_FLEX_FW)
endif()
if(PXX2)
add_definitions(-DPXX2)
endif()
if(CRSF_UNINVERTED)
add_definitions(-DCRSF_UNINVERTED)
endif()
if(EXTPWR_INVERT)
add_definitions(-DEXTPWR_INVERT)
endif()
if(CRSF_FULLDUPLEX)
add_definitions(-DCRSF_FULLDUPLEX)
endif()
set(SRC
${SRC}
opentx.cpp
-8
View File
@@ -181,10 +181,6 @@ const char * const audioFilenames[] = {
"servoko",
"rxko",
"modelpwr",
#if defined(PCBSKY9X)
"highmah",
"hightemp",
#endif
"error",
"warning1",
"warning2",
@@ -1077,10 +1073,6 @@ void audioEvent(unsigned int index)
audioQueue.playTone(2250, 80, 20, PLAY_REPEAT(2));
break;
case AU_TX_BATTERY_LOW:
#if defined(PCBSKY9X)
case AU_TX_MAH_HIGH:
case AU_TX_TEMP_HIGH:
#endif
audioQueue.playTone(1950, 160, 20, PLAY_REPEAT(2), 1);
audioQueue.playTone(2550, 160, 20, PLAY_REPEAT(2), -1);
break;
-4
View File
@@ -564,10 +564,6 @@ void audioTimerCountdown(uint8_t timer, int value);
#define AUDIO_WARNING1() AUDIO_BUZZER(audioEvent(AU_WARNING1), beep(3))
#define AUDIO_WARNING2() AUDIO_BUZZER(audioEvent(AU_WARNING2), beep(2))
#define AUDIO_TX_BATTERY_LOW() AUDIO_BUZZER(audioEvent(AU_TX_BATTERY_LOW), beep(4))
#if defined(PCBSKY9X)
#define AUDIO_TX_MAH_HIGH() audioEvent(AU_TX_MAH_HIGH)
#define AUDIO_TX_TEMP_HIGH() audioEvent(AU_TX_TEMP_HIGH)
#endif
#define AUDIO_ERROR() AUDIO_BUZZER(audioEvent(AU_ERROR), beep(4))
#define AUDIO_TIMER_COUNTDOWN(idx, val) audioTimerCountdown(idx, val)
#define AUDIO_TIMER_ELAPSED(idx) AUDIO_BUZZER(audioEvent(AU_TIMER1_ELAPSED+idx), beep(3))
-2
View File
@@ -709,9 +709,7 @@ int cliTrace(const char ** argv)
int cliStackInfo(const char ** argv)
{
#if !defined(PCBI6X)
serialPrint("[MAIN] %d available / %d", stackAvailable(), stackSize() * 4); // stackSize() returns size in 32bit chunks
#endif
serialPrint("[MENUS] %d available / %d", menusStack.available(), menusStack.size());
serialPrint("[MIXER] %d available / %d", mixerStack.available(), mixerStack.size());
#if defined(AUDIO)
+25 -43
View File
@@ -58,19 +58,8 @@
#define MAX_INPUTS 32
#define MAX_TRAINER_CHANNELS 16
#define MAX_TELEMETRY_SENSORS 32
#elif defined(PCBSKY9X)
#define MAX_MODELS 60
#define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
#define MAX_FLIGHT_MODES 9
#define MAX_MIXERS 64
#define MAX_EXPOS 32
#define MAX_LOGICAL_SWITCHES 64
#define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
#define MAX_INPUTS 32
#define MAX_TRAINER_CHANNELS 16
#define MAX_TELEMETRY_SENSORS 32
#elif defined(PCBI6X)
#define MAX_MODELS 16
#define MAX_MODELS 20
#define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
#define MAX_FLIGHT_MODES 5
#define MAX_MIXERS 32
@@ -145,7 +134,7 @@ enum CurveType {
#define MAX_CURVE_POINTS 512
#endif
#if defined(PCBTARANIS) || defined(PCBSKY9X) || defined(PCBHORUS) || defined(PCBI6X)
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6X)
#define NUM_MODULES 2
#else
#define NUM_MODULES 1
@@ -153,16 +142,8 @@ enum CurveType {
#define XPOTS_MULTIPOS_COUNT 6
#if defined(PCBSKY9X) && defined(REVX)
#define MAX_ROTARY_ENCODERS 1
#define NUM_ROTARY_ENCODERS 0
#elif defined(PCBSKY9X)
#define MAX_ROTARY_ENCODERS 1
#define NUM_ROTARY_ENCODERS 1
#else
#define MAX_ROTARY_ENCODERS 0
#define NUM_ROTARY_ENCODERS 0
#endif
#define MAX_ROTARY_ENCODERS 0
#define NUM_ROTARY_ENCODERS 0
#if defined(COLORLCD)
enum MainViews {
@@ -207,6 +188,14 @@ enum BeeperMode {
TRAINER_MODULE,
FLASHING_MODULE,
};
enum ArmingMode {
ARMING_MODE_FIRST = 0,
ARMING_MODE_CH5 = ARMING_MODE_FIRST,
ARMING_MODE_SWITCH = 1,
ARMING_MODE_LAST = ARMING_MODE_SWITCH,
};
enum TrainerMode {
TRAINER_MODE_MASTER_TRAINER_JACK,
#if !defined(PCBI6X)
@@ -222,12 +211,6 @@ enum BeeperMode {
TRAINER_MODE_SLAVE_BLUETOOTH,
#endif
};
#elif defined(PCBSKY9X)
enum ModuleIndex {
EXTERNAL_MODULE,
EXTRA_MODULE,
TRAINER_MODULE
};
#endif
#if defined(BLUETOOTH)
@@ -235,15 +218,17 @@ enum BeeperMode {
#elif defined(PCBX7) || defined(PCBXLITE)
#define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
#elif defined(PCBI6X)
#define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
#if defined(SBUS_TRAINER)
#define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
#else
#define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_TRAINER_JACK
#endif
#else
#define TRAINER_MODE_MAX() HAS_WIRELESS_TRAINER_HARDWARE() ? TRAINER_MODE_MASTER_BATTERY_COMPARTMENT : TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
#endif
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6X)
#define IS_INTERNAL_MODULE_ENABLED() (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE)
#elif defined(PCBSKY9X)
#define IS_INTERNAL_MODULE_ENABLED() (false)
#endif
#define IS_EXTERNAL_MODULE_ENABLED() (g_model.moduleData[EXTERNAL_MODULE].type != MODULE_TYPE_NONE)
@@ -258,7 +243,7 @@ enum UartModes {
#if !defined(PCBI6X)
UART_MODE_TELEMETRY,
#endif
#if defined(SBUS)
#if defined(SBUS_TRAINER)
UART_MODE_SBUS_TRAINER,
#endif
#if defined(LUA)
@@ -497,10 +482,6 @@ enum SwitchSources {
SWSRC_TrimT6Up,
#endif
#if defined(PCBSKY9X)
SWSRC_REa,
#endif
SWSRC_FIRST_LOGICAL_SWITCH,
SWSRC_SW1 = SWSRC_FIRST_LOGICAL_SWITCH,
SWSRC_SW2,
@@ -607,11 +588,6 @@ enum MixSources {
MIXSRC_MOUSE2, LUA_EXPORT("jsy", "Joystick Y")
#endif
#if defined(PCBSKY9X)
MIXSRC_REa,
MIXSRC_LAST_ROTARY_ENCODER = MIXSRC_REa,
#endif
MIXSRC_MAX,
MIXSRC_FIRST_HELI,
@@ -772,7 +748,6 @@ enum Functions {
#if defined(PCBTARANIS)
FUNC_SCREENSHOT,
#endif
FUNC_SET_SCREEN,
#if defined(DEBUG)
FUNC_TEST, // should remain the last before MAX as not added in Companion
#endif
@@ -833,4 +808,11 @@ enum BluetoothModes {
BLUETOOTH_TRAINER,
};
// PPM Units
enum PPMUnit {
PPM_PERCENT_PREC0,
PPM_PERCENT_PREC1,
PPM_US
};
#endif // _DATACONSTANTS_H_
+9 -59
View File
@@ -435,15 +435,6 @@ PACK(struct ModuleData {
uint8_t lowPowerMode : 1;
int8_t optionValue;
} multi);
NOBACKUP(struct {
uint8_t power : 2; // 0=10 mW, 1=100 mW, 2=500 mW, 3=1W
uint8_t spare1 : 2;
uint8_t receiver_telem_off : 1; // false = receiver telem enabled
uint8_t receiver_channel_9_16 : 1; // false = pwm out 1-8, true 9-16
uint8_t external_antenna : 1; // false = internal antenna, true = external antenna
uint8_t fast : 1; // TODO: to be used later by external module (fast means serial @ high speed)
uint8_t spare2;
} pxx);
NOBACKUP(struct {
uint8_t spare1 : 6;
uint8_t noninverted : 1;
@@ -453,6 +444,11 @@ PACK(struct ModuleData {
NOBACKUP(struct {
uint16_t servoFreq; // 50 - 400
} afhds2a);
NOBACKUP(struct {
uint8_t crsfArmingMode:1;
int16_t crsfArmingTrigger:10;
int16_t spare1:5;
} crsf);
};
// Helper functions to set both of the rfProto protocol at the same time
@@ -581,15 +577,6 @@ PACK(struct CustomScreenData {
uint8_t potsWarnEnabled; \
int8_t potsWarnPosition[NUM_POTS + NUM_SLIDERS]; \
uint8_t rxBattAlarms[2];
#elif defined(PCBSKY9X)
#define MODELDATA_EXTRA \
uint8_t spare : 6; \
uint8_t potsWarnMode : 2; \
ModuleData moduleData[NUM_MODULES + 1]; \
char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; \
uint8_t potsWarnEnabled; \
int8_t potsWarnPosition[NUM_POTS + NUM_SLIDERS]; \
uint8_t rxBattAlarms[2];
#else
#define MODELDATA_EXTRA
#endif
@@ -666,12 +653,6 @@ PACK(struct TrainerData {
NOBACKUP(TrainerMix mix[4]);
});
#if defined(PCBHORUS)
#define SPLASH_MODE uint8_t splashSpares : 3
#else
#define SPLASH_MODE int8_t splashMode : 3
#endif
#define EXTRA_GENERAL_FIELDS_ARM \
NOBACKUP(uint8_t backlightBright); \
NOBACKUP(uint32_t globalTimer); \
@@ -682,7 +663,8 @@ PACK(struct TrainerData {
NOBACKUP(uint8_t jitterFilter : 1); /* 0 - active */ \
NOBACKUP(uint8_t disableRssiPoweroffAlarm : 1); \
NOBACKUP(uint8_t USBMode : 2); \
NOBACKUP(uint8_t spareExtraArm : 3); \
NOBACKUP(uint8_t spare : 1); \
NOBACKUP(uint8_t ppmunit : 2); \
NOBACKUP(char ttsLanguage[2]); \
NOBACKUP(int8_t beepVolume : 4); \
NOBACKUP(int8_t wavVolume : 4); \
@@ -725,21 +707,6 @@ PACK(struct TrainerData {
char anaNames[NUM_STICKS + NUM_POTS + NUM_SLIDERS][LEN_ANA_NAME]; \
uint8_t receiverId[16][4]; /* AFHDS2A RxNum */ \
BLUETOOTH_FIELDS
#elif defined(PCBSKY9X)
#define EXTRA_GENERAL_FIELDS \
EXTRA_GENERAL_FIELDS_ARM \
int8_t txCurrentCalibration; \
int8_t temperatureWarn; \
uint8_t mAhWarn; \
uint16_t mAhUsed; \
int8_t temperatureCalib; \
uint8_t optrexDisplay; \
uint8_t sticksGain; \
uint8_t rotarySteps; \
char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \
char anaNames[NUM_STICKS + NUM_POTS + NUM_SLIDERS][LEN_ANA_NAME]; \
\
#define EXTRA_GENERAL_FIELDS EXTRA_GENERAL_FIELDS_ARM
#endif
#if defined(PCBHORUS)
@@ -760,7 +727,7 @@ PACK(struct TrainerData {
PACK(struct RadioData {
NOBACKUP(uint8_t version);
NOBACKUP(uint16_t variant);
NOBACKUP(uint16_t variant); // not used on PCBI6X, reuse for swconfig_t?
CalibData calib[NUM_CALIBRATED_ANALOGS];
NOBACKUP(uint16_t chkSum);
N_HORUS_FIELD(int8_t currModel);
@@ -781,7 +748,7 @@ PACK(struct RadioData {
NOBACKUP(uint8_t adjustRTC : 1);
NOBACKUP(uint8_t inactivityTimer);
uint8_t telemetryBaudrate : 3;
SPLASH_MODE; /* 3bits */
int8_t splashMode : 3;
NOBACKUP(int8_t hapticMode : 2); // -2=quiet, -1=only alarms, 0=no keys, 1=all
int8_t switchesDelay;
NOBACKUP(uint8_t lightAutoOff);
@@ -809,7 +776,6 @@ PACK(struct RadioData {
#undef TELEMETRY_DATA
#undef MODELDATA_EXTRA
#undef CUSTOM_SCREENS_DATA
#undef SPLASH_MODE
#undef EXTRA_GENERAL_FIELDS
#undef THEME_DATA
#undef NOBACKUP
@@ -879,19 +845,6 @@ static inline void check_struct() {
CHKSIZE(CurveData, 4);
CHKSIZE(CustomScreenData, 610);
CHKSIZE(Topbar::PersistentData, 216);
#elif defined(PCBSKY9X)
CHKSIZE(MixData, 20);
CHKSIZE(ExpoData, 17);
CHKSIZE(LimitData, 11);
CHKSIZE(CustomFunctionData, 9);
CHKSIZE(FlightModeData, 38);
CHKSIZE(TimerData, 11);
CHKSIZE(SwashRingData, 8);
CHKSIZE(FrSkyBarData, 5);
CHKSIZE(FrSkyLineData, 2);
CHKSIZE(FrSkyTelemetryData, 88);
CHKSIZE(ModelHeader, 12);
CHKTYPE(CurveData, 4);
#elif defined(PCBI6X)
CHKSIZE(LimitData, 11);
CHKSIZE(MixData, 20);
@@ -951,9 +904,6 @@ static inline void check_struct() {
#elif defined(PCBX9D)
CHKSIZE(RadioData, 872);
CHKSIZE(ModelData, 6507);
#elif defined(PCBSKY9X)
CHKSIZE(RadioData, 727);
CHKSIZE(ModelData, 5188);
#elif defined(PCBHORUS)
CHKSIZE(RadioData, 847);
CHKSIZE(ModelData, 9380);
+5 -21
View File
@@ -27,12 +27,8 @@ template <int N>
class DMAFifo
{
public:
#if defined(STM32F0)
explicit DMAFifo(DMA_Channel_TypeDef * stream):
#else
explicit DMAFifo(DMA_Stream_TypeDef * stream):
#endif
stream(stream),
explicit DMAFifo(DMA_Channel_TypeDef * channel):
channel(channel),
ridx(0)
{
}
@@ -49,11 +45,7 @@ class DMAFifo
uint8_t last(int index)
{
#if defined(STM32F0)
return fifo[(2*N - stream->CNDTR - index) & (N-1)];
#else
return fifo[(2*N - stream->NDTR - index) & (N-1)];
#endif
return fifo[(2*N - channel->CNDTR - index) & (N-1)];
}
bool isEmpty()
@@ -61,11 +53,7 @@ class DMAFifo
#if defined(SIMU)
return true;
#endif
#if defined(STM32F0)
return (ridx == N - stream->CNDTR);
#else
return (ridx == N - stream->NDTR);
#endif
return (ridx == N - channel->CNDTR);
}
bool pop(uint8_t & element)
@@ -85,11 +73,7 @@ class DMAFifo
return fifo;
}
#if defined(STM32F0)
DMA_Channel_TypeDef * stream;
#else
DMA_Stream_TypeDef * stream;
#endif
DMA_Channel_TypeDef * channel;
protected:
uint8_t fifo[N];
volatile uint32_t ridx;
+5 -12
View File
@@ -152,18 +152,18 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
#endif
#if defined(OVERRIDE_CHANNEL_FUNCTION)
for (uint8_t i=0; i<MAX_OUTPUT_CHANNELS; i++) {
for (uint32_t i=0; i<MAX_OUTPUT_CHANNELS; i++) {
safetyCh[i] = OVERRIDE_CHANNEL_UNDEFINED;
}
#endif
#if defined(GVARS)
for (uint8_t i=0; i<NUM_TRIMS; i++) {
for (uint32_t i=0; i<NUM_TRIMS; i++) {
trimGvar[i] = -1;
}
#endif
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
for (uint32_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
const CustomFunctionData * cfn = &functions[i];
swsrc_t swtch = CFN_SWITCH(cfn);
if (swtch) {
@@ -175,7 +175,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
active &= (bool)CFN_ACTIVE(cfn);
}
if (active || IS_PLAY_BOTH_FUNC(CFN_FUNC(cfn))) {
if (active) {
switch (CFN_FUNC(cfn)) {
@@ -426,13 +426,6 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
}
break;
#endif
case FUNC_SET_SCREEN:
if (isRepeatDelayElapsed(functions, functionsContext, i)) {
TRACE("SET VIEW %d", (CFN_PARAM(cfn)));
extern void showTelemScreen(uint8_t index);
showTelemScreen(CFN_PARAM(cfn));
}
break;
#if defined(DEBUG)
case FUNC_TEST:
testFunc();
@@ -467,7 +460,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
functionsContext.activeFunctions = newActiveFunctions;
#if defined(ROTARY_ENCODERS) && defined(GVARS)
for (uint8_t i=0; i<ROTARY_ENCODERS; i++) {
for (uint32_t i=0; i<ROTARY_ENCODERS; i++) {
rePreviousValues[i] = (rotencValue[i] / ROTARY_ENCODER_GRANULARITY);
}
#endif
+19 -22
View File
@@ -35,9 +35,6 @@
#define HEADER_LINE_COLUMNS 0,
#endif
#define COLUMN_X 0
#define drawFieldLabel(x, y, str) lcdDrawTextAlignedLeft(y, str)
#define NUM_BODY_LINES (LCD_LINES-1)
#define MENU_HEADER_HEIGHT FH
#define MENU_INIT_VPOS 0
@@ -53,21 +50,9 @@ extern uint8_t noHighlightCounter;
#define NO_HIGHLIGHT() (noHighlightCounter > 0)
#define START_NO_HIGHLIGHT() do { noHighlightCounter = 25; } while(0)
void drawSlider(coord_t x, coord_t y, uint8_t width, uint8_t value, uint8_t max, uint8_t attr);
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
#if defined(NAVIGATION_POT1)
extern int16_t p1valdiff;
#else
#define p1valdiff 0
#endif
#if defined(NAVIGATION_POT2)
extern int8_t p2valdiff;
#else
#define p2valdiff 0
#endif
extern int8_t checkIncDec_Ret; // global helper vars
#define EDIT_SELECT_MENU -1
@@ -225,8 +210,22 @@ void title(const char * s);
typedef int choice_t;
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label, LcdFlags attr, event_t event);
choice_t editChoice(coord_t x, coord_t y, const char *label,
const char *values, choice_t value, choice_t min,
choice_t max, LcdFlags attr, event_t event);
choice_t editChoice(coord_t x, coord_t y, const char *label,
const char *values, choice_t value, choice_t min,
choice_t max, LcdFlags attr, event_t event, coord_t lblX);
choice_t editChoice(coord_t x, coord_t y, const char *label,
const char *values, choice_t value, choice_t min,
choice_t max, LcdFlags attr, event_t event, coord_t lblX,
IsValueAvailable isValueAvailable);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label,
LcdFlags attr, event_t event);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label,
LcdFlags attr, event_t event, coord_t lblX);
int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, event_t event);
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
@@ -263,10 +262,6 @@ void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay);
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
#define WARNING_TYPE_ASTERISK 0
#define WARNING_TYPE_CONFIRM 1
#define WARNING_TYPE_INPUT 2
extern const char * warningText;
extern const char * warningInfoText;
extern uint8_t warningInfoLength;
@@ -372,6 +367,8 @@ void doMainScreenGraphics();
void drawProgressBar(const char * label, int num, int den);
void drawSleepBitmap();
void drawChannelValue(coord_t x, coord_t y, uint8_t ch, int16_t value, LcdFlags flags);
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max);
+21 -15
View File
@@ -66,7 +66,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
}
else if (i<=width) {
uint8_t skip = true;
for (uint8_t j=0; j<lines; j++) {
for (uint32_t j=0; j<lines; j++) {
b[j] = *(pattern++); /*top byte*/
if (b[j] != 0xff) {
skip = false;
@@ -74,7 +74,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
}
if (skip) {
if (flags & FIXEDWIDTH) {
for (uint8_t j=0; j<lines; j++) {
for (uint32_t j=0; j<lines; j++) {
b[j] = 0;
}
}
@@ -129,7 +129,7 @@ uint8_t getPatternWidth(const PatternData * pattern)
uint8_t lines = (pattern->height+7)/8;
const uint8_t * data = pattern->data;
for (int8_t i=0; i<pattern->width; i++) {
for (uint8_t j=0; j<lines; j++) {
for (uint32_t j=0; j<lines; j++) {
if (data[j] != 0xff) {
result += 1;
break;
@@ -409,6 +409,11 @@ void lcdDrawTextAlignedLeft(coord_t y, const char * s)
lcdDrawText(0, y, s);
}
void lcdDrawTextIndented(coord_t y, const char * s)
{
lcdDrawText(INDENT_WIDTH, y, s);
}
#if !defined(BOOT)
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags flags)
{
@@ -838,7 +843,7 @@ void putsRotaryEncoderMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, Lcd
}
#endif
void drawValueWithUnit(coord_t x, coord_t y, int val, uint8_t unit, LcdFlags att)
void drawValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags att)
{
// convertUnit(val, unit);
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
@@ -878,14 +883,19 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L
lcdDrawSizedText(lcdLastRightPos+1, y, direction + (value>=0 ? 0 : 1), 1);
}
void drawTime(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
{
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0, 2);
lcdDrawText(lcdNextPos, y, ":", att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0, 2);
lcdDrawText(lcdNextPos, y, ":", att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0, 2);
}
void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
{
if (BLINK_ON_PHASE) {
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0, 2);
lcdDrawText(lcdNextPos, y, ":", att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0, 2);
lcdDrawText(lcdNextPos, y, ":", att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0, 2);
drawTime(x, y, telemetryItem, att);
}
else {
lcdDrawNumber(x, y, telemetryItem.datetime.year, att|LEADING0|LEFT, 4);
@@ -940,11 +950,7 @@ void drawTelemScreenDate(coord_t x, coord_t y, source_t sensor, LcdFlags att)
sensor = (sensor-MIXSRC_FIRST_TELEM) / 3;
TelemetryItem & telemetryItem = telemetryItems[sensor];
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0, 2);
lcdDrawText(lcdNextPos, y, ":", att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0, 2);
lcdDrawText(lcdNextPos, y, ":", att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0, 2);
drawTime(x, y, telemetryItem, att);
lcdDrawNumber(x-29, y, telemetryItem.datetime.month, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdNextPos, y, '-', att);
@@ -985,7 +991,7 @@ void lcdDraw1bitBitmap(coord_t x, coord_t y, const uint8_t * img, uint8_t idx, L
uint8_t hb = ((*q++) + 7) / 8;
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
q += idx*w*hb;
for (uint8_t yb = 0; yb < hb; yb++) {
for (uint32_t yb = 0; yb < hb; yb++) {
uint8_t *p = &displayBuf[(y / 8 + yb) * LCD_W + x];
for (coord_t i=0; i<w; i++){
uint8_t b = *q++;
+3 -8
View File
@@ -44,7 +44,7 @@ typedef uint8_t display_t;
#define BLINK 0x01
#define INVERS 0x02
#if defined(BOLD_FONT)
#define BOLD 0x40
#define BOLD 0x40u
#else
#define BOLD 0x00
#endif
@@ -53,10 +53,9 @@ typedef uint8_t display_t;
#define CENTERED 0x20
#define CONDENSED 0x08
#define FIXEDWIDTH 0x10
/* lcd puts flags */
/* no 0x80 here because of "GV"1 which is aligned LEFT */
/* no 0x10 here because of "MODEL"01 which uses LEADING0 */
#define ZCHAR 0x80
#define ZCHAR 0x80u
/* lcdDrawNumber additional flags */
#define LEADING0 0x10
@@ -98,11 +97,6 @@ extern coord_t lcdNextPos;
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
#define ASSERT_IN_DISPLAY(p) assert((p) >= displayBuf && (p) < DISPLAY_END)
#if defined(PCBSKY9X)
extern volatile uint8_t lcdLock ;
extern volatile uint32_t lcdInputs ;
#endif
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c);
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags);
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags flags);
@@ -111,6 +105,7 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len, L
void lcdDrawText(coord_t x, coord_t y, const char * s);
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len);
void lcdDrawTextAlignedLeft(coord_t y, const char * s);
void lcdDrawTextIndented(coord_t y, const char * s);
void drawTimerWithMode(coord_t x, coord_t y, uint8_t index, LcdFlags att);
void lcdDrawHexNumber(coord_t x, coord_t y, uint32_t val, LcdFlags mode=0);
@@ -37,8 +37,8 @@ void onModelCustomScriptMenu(const char *result)
POPUP_WARNING(STR_NO_SCRIPTS_ON_SD);
}
}
else {
// The user choosed a lua file in the list
else if (result) {
// The user chosen a lua file in the list
copySelection(sd.file, result, sizeof(sd.file));
memset(sd.inputs, 0, sizeof(sd.inputs));
storageDirty(EE_MODEL);
+3 -3
View File
@@ -98,8 +98,8 @@ void onTelemetryScriptFileSelectionMenu(const char * result)
POPUP_WARNING(STR_NO_SCRIPTS_ON_SD);
}
}
else {
// The user choosed a file in the list
else if (result != STR_EXIT) {
// The user chosen a file in the list
memcpy(g_model.frsky.screens[screenIndex].script.file, result, sizeof(g_model.frsky.screens[screenIndex].script.file));
storageDirty(EE_MODEL);
LUA_LOAD_MODEL_SCRIPTS();
@@ -130,7 +130,7 @@ void menuModelDisplay(event_t event)
int8_t sub = menuVerticalPosition - HEADER_LINE;
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
int k = i + menuVerticalOffset;
SKIP_HIDDEN_MENU_ROWS(k);
+8 -8
View File
@@ -86,14 +86,14 @@ void menuModelFlightModeOne(event_t event)
if (s_currIdx == 0 && sub>=ITEM_MODEL_FLIGHT_MODE_SWITCH)
sub += VERTICAL_SHIFT;
for (uint8_t k=0; k<LCD_LINES-1; k++) {
for (uint32_t k=0; k<LCD_LINES-1; k++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
int8_t i = k + menuVerticalOffset;
if (s_currIdx == 0 && i>=ITEM_MODEL_FLIGHT_MODE_SWITCH) i += VERTICAL_SHIFT;
uint8_t attr = (sub==i ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
#else
for (uint8_t i=0, k=0, y=PHASE_ONE_FIRST_LINE; i<ITEM_MODEL_FLIGHT_MODE_MAX; i++, k++, y+=FH) {
for (uint32_t i=0, k=0, y=PHASE_ONE_FIRST_LINE; i<ITEM_MODEL_FLIGHT_MODE_MAX; i++, k++, y+=FH) {
if (s_currIdx == 0 && i==ITEM_MODEL_FLIGHT_MODE_SWITCH) i = ITEM_MODEL_FLIGHT_MODE_FADE_IN;
uint8_t attr = (sub==k ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
#endif
@@ -108,7 +108,7 @@ void menuModelFlightModeOne(event_t event)
case ITEM_MODEL_FLIGHT_MODE_TRIMS:
lcdDrawTextAlignedLeft(y, STR_TRIMS);
for (uint8_t t = 0; t < NUM_STICKS; t++) {
for (uint32_t t = 0; t < NUM_STICKS; t++) {
drawTrimMode(MIXES_2ND_COLUMN + (t*2*FW), y, s_currIdx, t, menuHorizontalPosition == t ? attr : 0);
#if defined(NAVIGATION_9X)
if (s_editMode > 0 && attr && menuHorizontalPosition == t) {
@@ -126,7 +126,7 @@ void menuModelFlightModeOne(event_t event)
lcdDrawTextAlignedLeft(y, STR_ROTARY_ENCODER);
for (uint8_t t=0; t<NUM_ROTARY_ENCODERS; t++) {
putsRotaryEncoderMode(MIXES_2ND_COLUMN+(t*FW), y, s_currIdx, t, menuHorizontalPosition==t ? attr : 0);
if (attr && menuHorizontalPosition==t && ((editMode>0) || p1valdiff)) {
if (attr && menuHorizontalPosition==t && (editMode > 0)) {
int16_t v = flightModeAddress(s_currIdx)->rotaryEncoders[t];
if (v < ROTARY_ENCODER_MAX) v = ROTARY_ENCODER_MAX;
v = checkIncDec(event, v, ROTARY_ENCODER_MAX, ROTARY_ENCODER_MAX+MAX_FLIGHT_MODES-1, EE_MODEL);
@@ -175,7 +175,7 @@ void menuModelFlightModeOne(event_t event)
else {
lcdDrawText(9*FW, y, STR_OWN, posHorz==1 ? attr : 0);
}
if (attr && s_currIdx>0 && posHorz==1 && (editMode>0 || p1valdiff)) {
if (attr && s_currIdx>0 && posHorz==1 && editMode > 0) {
if (v < GVAR_MAX) v = GVAR_MAX;
v = checkIncDec(event, v, GVAR_MAX, GVAR_MAX+MAX_FLIGHT_MODES-1, EE_MODEL);
if (checkIncDec_Ret) {
@@ -250,7 +250,7 @@ void menuModelFlightModesAll(event_t event)
lcdDrawSizedText(4*FW+NAME_OFS, y, p->name, sizeof(p->name), ZCHAR);
#endif
if (i == 0) {
for (uint8_t t=0; t<NUM_STICKS; t++) {
for (uint32_t t=0; t<NUM_STICKS; t++) {
#if defined(PCBTARANIS) || defined(PCBI6X)
drawTrimMode(TRIMS_POS+t*FW*2, y, i, t, 0);
#else
@@ -261,12 +261,12 @@ void menuModelFlightModesAll(event_t event)
else {
#if defined(PCBTARANIS) || defined(PCBI6X)
drawSwitch(SWITCH_POS, y, p->swtch, 0);
for (uint8_t t=0; t<NUM_STICKS; t++) {
for (uint32_t t=0; t<NUM_STICKS; t++) {
drawTrimMode(TRIMS_POS+t*FW*2, y, i, t, 0);
}
#else
drawSwitch((4+LEN_FLIGHT_MODE_NAME)*FW+SWITCH_OFS, y, p->swtch, 0);
for (uint8_t t=0; t<NUM_STICKS; t++) {
for (uint32_t t=0; t<NUM_STICKS; t++) {
drawShortTrimMode((9+LEN_FLIGHT_MODE_NAME+t)*FW+TRIMS_OFS, y, i, t, 0);
}
#endif
+2 -2
View File
@@ -91,13 +91,13 @@ void menuModelGVarOne(event_t event)
break;
case GVAR_FIELD_MIN:
lcdDrawText(0, y, STR_MIN);
lcdDrawTextAlignedLeft(y, STR_MIN);
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdxSubMenu, GVAR_MIN+gvar->min, LEFT|attr);
if (attr) gvar->min = checkIncDec(event, GVAR_MIN+gvar->min, GVAR_MIN, GVAR_MAX-gvar->max, EE_MODEL) - GVAR_MIN;
break;
case GVAR_FIELD_MAX:
lcdDrawText(0, y, STR_MAX);
lcdDrawTextAlignedLeft(y, STR_MAX);
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdxSubMenu, GVAR_MAX-gvar->max, LEFT|attr);
if (attr) gvar->max = GVAR_MAX - checkIncDec(event, GVAR_MAX-gvar->max, GVAR_MIN+gvar->min, GVAR_MAX, EE_MODEL);
break;
+9 -9
View File
@@ -240,7 +240,7 @@ void menuModelExpoOne(event_t event)
coord_t y = MENU_HEADER_HEIGHT + 1;
for (uint8_t i=0; i<EXPO_FIELD_MAX+1; i++) {
for (uint32_t i=0; i<EXPO_FIELD_MAX+1; i++) {
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
switch (i) {
case EXPO_FIELD_NAME:
@@ -361,13 +361,13 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
}
lcdDrawSolidVerticalLine(x+GAUGE_WIDTH/2-1, y, GAUGE_HEIGHT+1);
if (barMin == -101) {
for (uint8_t i=0; i<3; ++i) {
for (uint32_t i=0; i<3; ++i) {
lcdDrawPoint(x+i, y+4-i);
lcdDrawPoint(x+3+i, y+4-i);
}
}
if (barMax == 101) {
for (uint8_t i=0; i<3; ++i) {
for (uint32_t i=0; i<3; ++i) {
lcdDrawPoint(x+GAUGE_WIDTH-8+i, y+4-i);
lcdDrawPoint(x+GAUGE_WIDTH-5+i, y+4-i);
}
@@ -404,17 +404,17 @@ void menuModelMixOne(event_t event)
editSingleName(COLUMN_X+MIXES_2ND_COLUMN, y, STR_MIXNAME, md2->name, sizeof(md2->name), event, attr);
break;
case MIX_FIELD_SOURCE:
drawFieldLabel(COLUMN_X, y, STR_SOURCE);
lcdDrawTextAlignedLeft(y, STR_SOURCE);
drawSource(COLUMN_X+MIXES_2ND_COLUMN, y, md2->srcRaw, STREXPANDED|attr);
if (attr) CHECK_INCDEC_MODELSOURCE(event, md2->srcRaw, 1, MIXSRC_LAST);
break;
case MIX_FIELD_WEIGHT:
drawFieldLabel(COLUMN_X, y, STR_WEIGHT);
lcdDrawTextAlignedLeft(y, STR_WEIGHT);
gvarWeightItem(COLUMN_X+MIXES_2ND_COLUMN, y, md2, attr|LEFT, event);
break;
case MIX_FIELD_OFFSET:
{
drawFieldLabel(COLUMN_X, y, STR_OFFSET);
lcdDrawTextAlignedLeft(y, STR_OFFSET);
u_int8int16_t offset;
MD_OFFSET_TO_UNION(md2, offset);
offset.word = GVAR_MENU_ITEM(COLUMN_X+MIXES_2ND_COLUMN, y, offset.word, GV_RANGELARGE_OFFSET_NEG, GV_RANGELARGE_OFFSET, attr|LEFT, 0, event);
@@ -427,7 +427,7 @@ void menuModelMixOne(event_t event)
{
uint8_t not_stick = (md2->srcRaw > NUM_STICKS);
int8_t carryTrim = -md2->carryTrim;
drawFieldLabel(COLUMN_X, y, STR_TRIM);
lcdDrawTextAlignedLeft(y, STR_TRIM);
lcdDrawTextAtIndex((not_stick ? COLUMN_X+MIXES_2ND_COLUMN : COLUMN_X+6*FW-3), y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, menuHorizontalPosition==0 ? attr : 0);
if (attr && menuHorizontalPosition==0 && (not_stick || editMode>0)) md2->carryTrim = -checkIncDecModel(event, carryTrim, not_stick ? TRIM_ON : -TRIM_OFF, -TRIM_AIL);
if (!not_stick) {
@@ -443,7 +443,7 @@ void menuModelMixOne(event_t event)
case MIX_FIELD_CURVE:
{
drawFieldLabel(COLUMN_X, y, STR_CURVE);
lcdDrawTextAlignedLeft(y, STR_CURVE);
int8_t curveParam = md2->curveParam;
if (md2->curveMode == MODE_CURVE) {
drawCurveName(COLUMN_X+MIXES_2ND_COLUMN, y, curveParam, attr);
@@ -482,7 +482,7 @@ void menuModelMixOne(event_t event)
md2->swtch = editSwitch(COLUMN_X+MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
break;
case MIX_FIELD_WARNING:
drawFieldLabel(COLUMN_X+MIXES_2ND_COLUMN, y, STR_MIXWARNING);
lcdDrawTextAlignedLeft(y, STR_MIXWARNING);
if (md2->mixWarn)
lcdDrawNumber(COLUMN_X+MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
else
+15 -13
View File
@@ -234,26 +234,20 @@ void onLogicalSwitchesMenu(const char *result)
s_currIdx = sub;
pushMenu(menuModelLogicalSwitchOne);
}
#if defined(SDCARD)
if (result == STR_COPY) {
#if defined(CLIPBOARD)
else if (result == STR_COPY) {
clipboard.type = CLIPBOARD_TYPE_CUSTOM_SWITCH;
clipboard.data.csw = *cs;
}
else if (result == STR_PASTE) {
*cs = clipboard.data.csw;
storageDirty(EE_MODEL);
}
else
#endif
if (result == STR_CLEAR) {
else if (result == STR_CLEAR) {
memset(cs, 0, sizeof(LogicalSwitchData));
storageDirty(EE_MODEL);
}
}
void menuModelLogicalSwitches(event_t event)
@@ -264,14 +258,14 @@ void menuModelLogicalSwitches(event_t event)
uint8_t k = 0;
int8_t sub = menuVerticalPosition - HEADER_LINE;
if (event==EVT_KEY_FIRST(KEY_ENTER)) {
if (event == EVT_KEY_FIRST(KEY_ENTER)) {
killEvents(event);
LogicalSwitchData * cs = lswAddress(sub);
if (cs->func)
s_currIdx = sub;
if (sub >= 0)
POPUP_MENU_ADD_ITEM(STR_EDIT);
#if defined(SDCARD)
#if defined(CLIPBOARD)
if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw)
POPUP_MENU_ADD_ITEM(STR_COPY);
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_SWITCH)
@@ -279,10 +273,18 @@ void menuModelLogicalSwitches(event_t event)
#endif
if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw)
POPUP_MENU_ADD_ITEM(STR_CLEAR);
POPUP_MENU_START(onLogicalSwitchesMenu);
if (popupMenuItemsCount == 1) {
popupMenuItemsCount = 0;
s_currIdx = sub;
pushMenu(menuModelLogicalSwitchOne);
}
else {
s_editMode = 0; // Was set in 'check' function.
POPUP_MENU_START(onLogicalSwitchesMenu);
}
}
for (uint8_t i=0; i<LCD_LINES-1; i++) {
for (uint32_t i=0; i<LCD_LINES-1; i++) {
y = 1 + (i+1)*FH;
k = i + menuVerticalOffset;
LogicalSwitchData * cs = lswAddress(k);
+3 -3
View File
@@ -70,13 +70,13 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
}
lcdDrawSolidVerticalLine(x+gaugeWidth/2-1, y, gaugeHeight+1);
if (barMin == -101) {
for (uint8_t i=0; i<3; ++i) {
for (uint32_t i=0; i<3; ++i) {
lcdDrawPoint(x+i, y+4-i);
lcdDrawPoint(x+3+i, y+4-i);
}
}
if (barMax == 101) {
for (uint8_t i=0; i<3; ++i) {
for (uint32_t i=0; i<3; ++i) {
lcdDrawPoint(x+gaugeWidth-8+i, y+4-i);
lcdDrawPoint(x+gaugeWidth-5+i, y+4-i);
}
@@ -165,7 +165,7 @@ void menuModelMixOne(event_t event)
break;
case MIX_FIELD_WARNING:
drawFieldLabel(MIXES_2ND_COLUMN, y, STR_MIXWARNING);
lcdDrawTextAlignedLeft(y, STR_MIXWARNING);
if (md2->mixWarn)
lcdDrawNumber(MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
else
+34 -40
View File
@@ -33,14 +33,6 @@ enum MenuModelOutputsItems {
ITEM_OUTPUTS_MAXROW = ITEM_OUTPUTS_COUNT-1
};
#if defined(PPM_UNIT_US)
#define LIMITS_MIN_POS 12*FW+1
#define PREC_THRESHOLD 804
#else
#define LIMITS_MIN_POS 12*FW-2
#define PREC_THRESHOLD 0
#endif
#define LIMITS_OFFSET_POS 8*FW-1
#if defined(PPM_LIMITS_SYMETRICAL)
@@ -70,14 +62,6 @@ enum MenuModelOutputsItems {
#define CONVERT_US_MIN_MAX(x) ((int16_t(x)*128)/25)
#define MIN_MAX_ATTR attr
#if defined(PPM_UNIT_US)
#define SET_MIN_MAX(x, val) x = ((val)*250)/128
#define MIN_MAX_DISPLAY(x) CONVERT_US_MIN_MAX(x)
#else
#define MIN_MAX_DISPLAY(x) (x)
#define SET_MIN_MAX(x, val) x = (val)
#endif
enum MenuModelOutputsOneItems {
ITEM_OUTPUTONE_CH_NAME,
ITEM_OUTPUTONE_OFFSET,
@@ -96,6 +80,13 @@ enum MenuModelOutputsOneItems {
#define LIMITS_ONE_2ND_COLUMN (13*FW)
int32_t minMaxDisplay(int32_t val)
{
if (g_eeGeneral.ppmunit == PPM_US)
val = CONVERT_US_MIN_MAX(val);
return val;
}
void menuModelLimitsOne(event_t event)
{
TITLE(STR_MENULIMITS);
@@ -113,7 +104,7 @@ void menuModelLimitsOne(event_t event)
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
uint8_t i = k + menuVerticalOffset;
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
uint8_t active = (attr && (s_editMode>0 || p1valdiff)) ;
uint8_t active = (attr && s_editMode > 0) ;
int limit = (g_model.extendedLimits ? LIMIT_EXT_MAX : 1000);
switch (i) {
@@ -132,7 +123,7 @@ void menuModelLimitsOne(event_t event)
ld->min = GVAR_MENU_ITEM(LIMITS_ONE_2ND_COLUMN, y, ld->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, attr|PREC1, 0, event);
break;
}
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, MIN_MAX_DISPLAY(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1);
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, minMaxDisplay(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1);
if (active) {
ld->min = LIMITS_MIN_MAX_OFFSET + checkIncDec(event, ld->min-LIMITS_MIN_MAX_OFFSET, -limit, 0, EE_MODEL, NULL, stops1000);
}
@@ -144,7 +135,7 @@ void menuModelLimitsOne(event_t event)
ld->max = GVAR_MENU_ITEM(LIMITS_ONE_2ND_COLUMN, y, ld->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, attr|PREC1, 0, event);
break;
}
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, MIN_MAX_DISPLAY(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1);
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, minMaxDisplay(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1);
if (active) {
ld->max = -LIMITS_MIN_MAX_OFFSET + checkIncDec(event, ld->max+LIMITS_MIN_MAX_OFFSET, 0, +limit, EE_MODEL, NULL, stops1000);
}
@@ -228,7 +219,7 @@ void menuModelLimits(event_t event)
SIMPLE_MENU(STR_MENULIMITS, menuTabModel, MENU_MODEL_OUTPUTS, HEADER_LINE+MAX_OUTPUT_CHANNELS+1);
for (uint8_t i=0; i<LCD_LINES-1; i++) {
for (uint32_t i=0; i<LCD_LINES-1; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i+menuVerticalOffset;
LcdFlags attr = (sub==MAX_OUTPUT_CHANNELS) ? INVERS : 0;
@@ -266,39 +257,42 @@ void menuModelLimits(event_t event)
lcdDrawSizedText(0, y, ld->name, sizeof(ld->name), ((sub==k) ? INVERS : 0) | ZCHAR | LEFT);
}
coord_t limitsMinPos = (g_eeGeneral.ppmunit == PPM_US) ? 12*FW+1 : 12*FW-2;
int precThreshold = (g_eeGeneral.ppmunit == PPM_US) ? 804 : 0;
for (uint8_t j=0; j<ITEM_OUTPUTS_COUNT; j++) {
switch (j) {
case ITEM_OUTPUTS_OFFSET:
#if defined(PPM_UNIT_US)
lcdDrawNumber(LIMITS_OFFSET_POS, y, ((int32_t)ld->offset*128) / 25, PREC1|RIGHT);
#else
if (g_eeGeneral.ppmunit == PPM_US) {
lcdDrawNumber(LIMITS_OFFSET_POS, y, ((int32_t)ld->offset*128) / 25, PREC1|RIGHT);
} else {
#if defined(GVARS)
if (GV_IS_GV_VALUE(ld->offset, -GV_RANGELARGE, GV_RANGELARGE)) {
drawGVarName(LIMITS_OFFSET_POS, y, ld->offset, attr|PREC1|RIGHT);
break;
}
if (GV_IS_GV_VALUE(ld->offset, -GV_RANGELARGE, GV_RANGELARGE)) {
drawGVarName(LIMITS_OFFSET_POS, y, ld->offset, attr|PREC1|RIGHT);
break;
}
#endif
if (abs(ld->offset) >= 1000) {
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset/10, RIGHT);
if (abs(ld->offset) >= 1000) {
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset/10, RIGHT);
}
else {
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset, PREC1|RIGHT);
}
}
else {
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset, PREC1|RIGHT);
}
#endif
break;
case ITEM_OUTPUTS_MIN:
#if defined(GVARS)
if (GV_IS_GV_VALUE(ld->min, -GV_RANGELARGE, GV_RANGELARGE)) {
drawGVarName(LIMITS_MIN_POS, y, ld->min, attr|PREC1|RIGHT);
drawGVarName(limitsMinPos, y, ld->min, attr|PREC1|RIGHT);
break;
}
#endif
if (ld->min <= PREC_THRESHOLD) {
lcdDrawNumber(LIMITS_MIN_POS, y, MIN_MAX_DISPLAY(ld->min-LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
if (ld->min <= precThreshold) {
lcdDrawNumber(limitsMinPos, y, minMaxDisplay(ld->min-LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
}
else {
lcdDrawNumber(LIMITS_MIN_POS, y, MIN_MAX_DISPLAY(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
lcdDrawNumber(limitsMinPos, y, minMaxDisplay(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
}
break;
@@ -309,11 +303,11 @@ void menuModelLimits(event_t event)
break;
}
#endif
if (ld->max >= -PREC_THRESHOLD) {
lcdDrawNumber(LIMITS_MAX_POS, y, MIN_MAX_DISPLAY(ld->max+LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
if (ld->max >= -precThreshold) {
lcdDrawNumber(LIMITS_MAX_POS, y, minMaxDisplay(ld->max+LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
}
else {
lcdDrawNumber(LIMITS_MAX_POS, y, MIN_MAX_DISPLAY(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
lcdDrawNumber(LIMITS_MAX_POS, y, minMaxDisplay(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
}
break;
+3 -13
View File
@@ -55,7 +55,7 @@ void onModelSelectMenu(const char * result)
SET_WARNING_INFO(modelHeaders[sub].name, sizeof(g_model.header.name), ZCHAR);
}
#if defined(SDCARD)
else {
else if (result != STR_EXIT) {
// The user choosed a file on SD to restore
storageCheck(true);
POPUP_WARNING(eeRestoreModel(sub, (char *)result));
@@ -86,12 +86,6 @@ void menuModelSelect(event_t event)
check_submenu_simple(_event_, MAX_MODELS - HEADER_LINE);
#if defined(NAVIGATION_POT2)
if (event==0 && p2valdiff<0) {
event = EVT_KEY_FIRST(KEY_RIGHT);
}
#endif
if (s_editMode > 0) s_editMode = 0;
@@ -299,14 +293,10 @@ void menuModelSelect(event_t event)
break;
}
#if defined(EEPROM_RLC)
#if defined(EEPROM_RLC) && !defined(PCBI6X) // should not be reached and warning will be raised anyway on low mem
lcdDrawText(9*FW-(LEN_FREE-4)*FW-4, 0, STR_FREE);
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();
lcdDrawNumber(lcdLastRightPos+3, 0, reusableBuffer.modelsel.eepromfree, LEFT);
#elif defined(EEPROM_RLC)
lcdDrawText(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();
lcdDrawNumber(17*FW, 0, reusableBuffer.modelsel.eepromfree, RIGHT);
#endif
#if defined(PCBX7)
@@ -319,7 +309,7 @@ void menuModelSelect(event_t event)
TITLE(STR_MENUMODELSEL);
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i+menuVerticalOffset;
+73 -144
View File
@@ -89,6 +89,10 @@ enum MenuModelSetupItems {
#endif
ITEM_MODEL_EXTERNAL_MODULE_LABEL,
ITEM_MODEL_EXTERNAL_MODULE_MODE,
#if defined(CROSSFIRE)
ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_MODE,
ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_TRIGGER,
#endif
#if defined(MULTIMODULE)
ITEM_MODEL_EXTERNAL_MODULE_SUBTYPE,
ITEM_MODEL_EXTERNAL_MODULE_STATUS,
@@ -96,21 +100,13 @@ enum MenuModelSetupItems {
#endif
ITEM_MODEL_EXTERNAL_MODULE_CHANNELS,
ITEM_MODEL_EXTERNAL_MODULE_BIND,
#if defined(PCBSKY9X) && defined(REVX)
ITEM_MODEL_EXTERNAL_MODULE_OUTPUT_TYPE,
#endif
ITEM_MODEL_EXTERNAL_MODULE_OPTIONS,
#if defined(MULTIMODULE)
ITEM_MODEL_EXTERNAL_MODULE_AUTOBIND,
#endif
ITEM_MODEL_EXTERNAL_MODULE_POWER,
#if defined(PCBSKY9X) && !defined(REVA)
ITEM_MODEL_EXTRA_MODULE_LABEL,
ITEM_MODEL_EXTRA_MODULE_CHANNELS,
ITEM_MODEL_EXTRA_MODULE_BIND,
#endif
ITEM_MODEL_EXTERNAL_MODULE_FAILSAFE,
#if defined(PCBTARANIS) || defined(PCBI6X)
#if defined(SBUS_TRAINER)
ITEM_MODEL_TRAINER_LABEL,
ITEM_MODEL_TRAINER_MODE,
#endif
@@ -132,14 +128,18 @@ enum MenuModelSetupItems {
#define MODEL_SETUP_RANGE_OFS 4*FW+3
#define MODEL_SETUP_SET_FAILSAFE_OFS 7*FW-2
#if defined(PCBTARANIS) || defined(PCBI6X)
#if defined(SBUS_TRAINER)
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_TRAINER_LABEL ? TRAINER_MODULE : (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE))
#elif defined(PCBSKY9X) && !defined(REVA)
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_EXTRA_MODULE_LABEL ? EXTRA_MODULE : EXTERNAL_MODULE)
// #elif defined(PCBI6X)
// #define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE)
#else
#define CURRENT_MODULE_EDITED(k) (EXTERNAL_MODULE)
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE)
#endif
#if defined(CROSSFIRE)
#define IF_MODULE_ARMED(module, xxx) (CRSF_ELRS_MIN_VER(4, 0) ? (uint8_t)(xxx) : HIDDEN_ROW)
#define IF_MODULE_ARMED_TRIGGER(module, xxx) ((CRSF_ELRS_MIN_VER(4, 0) && g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingMode) ? (uint8_t)(xxx) : HIDDEN_ROW)
#else
#define IF_MODULE_ARMED(module, xxx)
#define IF_MODULE_ARMED_TRIGGER(module, xxx)
#endif
#if defined(PCBXLITE)
@@ -157,11 +157,8 @@ enum MenuModelSetupItems {
#define INTERNAL_MODULE_CHANNELS_ROWS IF_INTERNAL_MODULE_ON(1)
#define EXTERNAL_MODULE_BIND_ROWS() ((isModuleXJT(EXTERNAL_MODULE) && IS_D8_RX(EXTERNAL_MODULE)) || isModuleSBUS(EXTERNAL_MODULE)) ? (uint8_t)1 : (isModulePPM(EXTERNAL_MODULE) || isModulePXX(EXTERNAL_MODULE) || isModuleDSM2(EXTERNAL_MODULE) || isModuleMultimodule(EXTERNAL_MODULE)) ? (uint8_t)2 : (isModuleCrossfire(EXTERNAL_MODULE)) ? (uint8_t)0 : HIDDEN_ROW
#if defined(PCBSKY9X) && defined(REVX)
#define OUTPUT_TYPE_ROWS() (isModulePPM(EXTERNAL_MODULE) ? (uint8_t)0 : HIDDEN_ROW) ,
#else
#define OUTPUT_TYPE_ROWS()
#endif
#define PORT_CHANNELS_ROWS(x) (x==EXTERNAL_MODULE ? EXTERNAL_MODULE_CHANNELS_ROWS : 0)
#define EXTERNAL_MODULE_MODE_ROWS (isModulePXX(EXTERNAL_MODULE) || isModuleDSM2(EXTERNAL_MODULE) || isModuleMultimodule(EXTERNAL_MODULE) || isModuleCrossfire(EXTERNAL_MODULE)) ? (uint8_t)1 : (uint8_t)0
@@ -171,11 +168,7 @@ enum MenuModelSetupItems {
#define POT_WARN_ITEMS() ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0)
#define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0
#define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2)
#if defined(PCBSKY9X) && !defined(REVA)
#define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2,
#else
#define EXTRA_MODULE_ROWS
#endif
#if defined(PCBX7)
#define ANTENNA_ROW
@@ -224,6 +217,7 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
}
}
#if defined(PCBTARANIS)
void onBindMenu(const char * result)
{
uint8_t moduleIdx = CURRENT_MODULE_EDITED(menuVerticalPosition);
@@ -250,6 +244,7 @@ void onBindMenu(const char * result)
moduleState[moduleIdx].mode = MODULE_MODE_BIND;
}
#endif
void menuModelSetup(event_t event)
@@ -339,6 +334,8 @@ void menuModelSetup(event_t event)
IF_INTERNAL_MODULE_ON(FAILSAFE_ROWS(INTERNAL_MODULE)),
LABEL(ExternalModule),
EXTERNAL_MODULE_MODE_ROWS,
IF_MODULE_ARMED(EXTERNAL_MODULE, 0), /* Arming Mode */
IF_MODULE_ARMED_TRIGGER(EXTERNAL_MODULE, 0), /* Arming TRIGGER */
MULTIMODULE_SUBTYPE_ROWS(EXTERNAL_MODULE)
MULTIMODULE_STATUS_ROWS
EXTERNAL_MODULE_CHANNELS_ROWS,
@@ -365,14 +362,16 @@ void menuModelSetup(event_t event)
TITLE(STR_MENUSETUP);
#if defined(PXX)
if (event == EVT_ENTRY) {
reusableBuffer.modelsetup.r9mPower = g_model.moduleData[EXTERNAL_MODULE].pxx.power;
}
#endif
uint8_t sub = menuVerticalPosition - HEADER_LINE;
int8_t editMode = s_editMode;
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
for (uint32_t i=0; i<NUM_BODY_LINES; ++i) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i + menuVerticalOffset;
for (int j=0; j<=k; j++) {
@@ -400,7 +399,7 @@ void menuModelSetup(event_t event)
drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1);
drawTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0);
drawTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, RIGHT | (menuHorizontalPosition==1 ? attr : 0), menuHorizontalPosition==2 ? attr : 0);
if (attr && (editMode > 0 || p1valdiff)) {
if (attr && editMode > 0) {
div_t qr = div(timer->start, 60);
switch (menuHorizontalPosition) {
case 0:
@@ -483,7 +482,7 @@ void menuModelSetup(event_t event)
s_editMode = 0;
if (event==EVT_KEY_LONG(KEY_ENTER)) {
START_NO_HIGHLIGHT();
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
for (uint32_t i=0; i<MAX_FLIGHT_MODES; i++) {
memclear(&g_model.flightModeData[i], TRIMS_ARRAY_SIZE);
}
storageDirty(EE_MODEL);
@@ -650,7 +649,7 @@ void menuModelSetup(event_t event)
}
}
for (uint8_t i=0; i<NUM_SWITCHES-1/*not on TRN switch*/; i++) {
for (uint32_t i=0; i<NUM_SWITCHES-1/*not on TRN switch*/; i++) {
uint8_t swactive = !(g_model.switchWarningEnable & 1 << i);
attr = 0;
@@ -724,13 +723,13 @@ void menuModelSetup(event_t event)
case ITEM_MODEL_BEEP_CENTER:
lcdDrawTextAlignedLeft(y, STR_BEEPCTR);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_ROTARY_ENCODERS; i++) {
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_ROTARY_ENCODERS; i++) {
// TODO flash saving, \001 not needed in STR_RETA123
coord_t x = MODEL_SETUP_2ND_COLUMN+i*FW;
lcdDrawTextAtIndex(x, y, STR_RETA123, i, ((menuHorizontalPosition==i) && attr) ? BLINK|INVERS : (((g_model.beepANACenter & ((BeepANACenter)1<<i)) || (attr && CURSOR_ON_LINE())) ? INVERS : 0 ) );
}
if (attr && CURSOR_ON_CELL) {
if (event==EVT_KEY_BREAK(KEY_ENTER) || p1valdiff) {
if (event==EVT_KEY_BREAK(KEY_ENTER)) {
if (READ_ONLY_UNLOCKED()) {
s_editMode = 0;
g_model.beepANACenter ^= ((BeepANACenter)1<<menuHorizontalPosition);
@@ -770,29 +769,22 @@ void menuModelSetup(event_t event)
#if defined(PCBI6X)
case ITEM_MODEL_INTERNAL_MODULE_MODE:
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
lcdDrawTextAtIndex(
MODEL_SETUP_2ND_COLUMN,
y,
STR_I6X_PROTOCOLS,
1+g_model.moduleData[INTERNAL_MODULE].rfProtocol,
attr);
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_I6X_PROTOCOLS, 1+g_model.moduleData[INTERNAL_MODULE].rfProtocol, attr);
if (attr) {
g_model.moduleData[INTERNAL_MODULE].rfProtocol =
checkIncDec(event,
g_model.moduleData[INTERNAL_MODULE].rfProtocol,
RF_I6X_PROTO_OFF,
RF_I6X_PROTO_LAST,
EE_MODEL,
isRfProtocolAvailable);
checkIncDec(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_I6X_PROTO_OFF, RF_I6X_PROTO_LAST, EE_MODEL, isRfProtocolAvailable);
if (checkIncDec_Ret) { // modified?
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_AFHDS2A_SPI;
g_model.moduleData[INTERNAL_MODULE].channelsStart = 0;
g_model.moduleData[INTERNAL_MODULE].channelsCount = MAX_OUTPUT_CHANNELS - 8; // 16
g_model.moduleData[INTERNAL_MODULE].afhds2a.servoFreq = 50;
if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF){
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_NONE;
}
}
}
break;
case ITEM_MODEL_INTERNAL_MODULE_SUBTYPE:
case ITEM_MODEL_INTERNAL_MODULE_SUBTYPE:
lcdDrawTextAlignedLeft(y, INDENT "Subtype");
lcdDrawTextAtIndex(
MODEL_SETUP_2ND_COLUMN,
@@ -821,12 +813,6 @@ void menuModelSetup(event_t event)
#endif
#if defined(PCBSKY9X)
case ITEM_MODEL_EXTRA_MODULE_LABEL:
lcdDrawTextAlignedLeft(y, "RF Port 2 (PPM)");
break;
#endif
case ITEM_MODEL_EXTERNAL_MODULE_LABEL:
lcdDrawTextAlignedLeft(y, TR_EXTERNALRF);
break;
@@ -852,7 +838,7 @@ void menuModelSetup(event_t event)
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_MULTI_PROTOCOLS, multi_rfProto, menuHorizontalPosition==1 ? attr : 0);
}
#endif
if (attr && (editMode>0 || p1valdiff)) {
if (attr && editMode > 0) {
switch (menuHorizontalPosition) {
case 0:
g_model.moduleData[EXTERNAL_MODULE].type = checkIncDec(
@@ -876,6 +862,7 @@ void menuModelSetup(event_t event)
SET_DEFAULT_PPM_FRAME_LENGTH(EXTERNAL_MODULE);
}
break;
#if !defined(PCBI6X) // no second column on i6X external module line
case 1:
if (isModuleDSM2(EXTERNAL_MODULE))
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, DSM2_PROTO_LP45, DSM2_PROTO_DSMX);
@@ -916,6 +903,7 @@ void menuModelSetup(event_t event)
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
g_model.moduleData[EXTERNAL_MODULE].channelsCount = defaultModuleChannels_M8(EXTERNAL_MODULE);
}
#endif // PCBI6X
}
}
break;
@@ -934,7 +922,7 @@ void menuModelSetup(event_t event)
if (pdef->subTypeString != nullptr)
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, pdef->subTypeString, g_model.moduleData[EXTERNAL_MODULE].subType, attr);
}
if (attr && (editMode > 0 || p1valdiff)) {
if (attr && editMode > 0) {
switch (menuHorizontalPosition) {
case 0:
if (multi_rfProto == MM_RF_CUSTOM_SELECTED)
@@ -952,7 +940,22 @@ void menuModelSetup(event_t event)
break;
#endif
#if defined(PCBTARANIS) || defined(PCBI6X)
#if defined(CROSSFIRE)
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_MODE:
g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingMode =
editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_CRSF_ARMING_MODE, STR_CRSF_ARMING_MODES,
g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingMode, ARMING_MODE_FIRST, ARMING_MODE_LAST, attr, event, INDENT_WIDTH);
break;
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_TRIGGER:
lcdDrawTextIndented(y, STR_SWITCH);
drawSwitch(MODEL_SETUP_2ND_COLUMN, y, g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingTrigger, attr);
if (attr)
CHECK_INCDEC_SWITCH(event, g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingTrigger, SWSRC_FIRST, SWSRC_LAST, EE_MODEL, isSwitchAvailableForArming);
break;
#endif
#if defined(PCBTARANIS) || defined(SBUS_TRAINER)
case ITEM_MODEL_TRAINER_LABEL:
lcdDrawTextAlignedLeft(y, STR_TRAINER);
break;
@@ -979,7 +982,7 @@ void menuModelSetup(event_t event)
s_editMode = 0;
}
if (bluetoothDistantAddr[0]) {
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
lcdDrawTextIndented(y+1, bluetoothDistantAddr, TINSIZE);
if (bluetoothState != BLUETOOTH_STATE_CONNECTED) {
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Bind"), menuHorizontalPosition == 0 ? attr : 0);
lcdDrawText(MODEL_SETUP_2ND_COLUMN+5*FW, y, BUTTON("Clear"), menuHorizontalPosition == 1 ? attr : 0);
@@ -998,7 +1001,7 @@ void menuModelSetup(event_t event)
}
}
else {
lcdDrawText(INDENT_WIDTH, y, "---");
lcdDrawTextIndented(y, "---");
if (bluetoothState < BLUETOOTH_STATE_IDLE)
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Init"), attr);
else
@@ -1013,9 +1016,9 @@ void menuModelSetup(event_t event)
}
else {
if (bluetoothDistantAddr[0])
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
lcdDrawTextIndented(y+1, bluetoothDistantAddr, TINSIZE);
else
lcdDrawText(INDENT_WIDTH, y, "---");
lcdDrawTextIndented(y, "---");
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, bluetoothState == BLUETOOTH_STATE_CONNECTED ? "Connected" : "!Connected");
}
break;
@@ -1024,9 +1027,6 @@ void menuModelSetup(event_t event)
#if defined(PCBTARANIS)
case ITEM_MODEL_TRAINER_CHANNELS:
case ITEM_MODEL_INTERNAL_MODULE_CHANNELS:
#endif
#if defined(PCBSKY9X)
case ITEM_MODEL_EXTRA_MODULE_CHANNELS:
#endif
case ITEM_MODEL_EXTERNAL_MODULE_CHANNELS:
{
@@ -1038,7 +1038,7 @@ void menuModelSetup(event_t event)
lcdDrawNumber(lcdLastRightPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
lcdDrawChar(lcdLastRightPos, y, '-');
lcdDrawNumber(lcdLastRightPos + FW+1, y, moduleData.channelsStart+sentModuleChannels(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
if (attr && (editMode>0 || p1valdiff)) {
if (attr && editMode > 0) {
switch (menuHorizontalPosition) {
case 0:
CHECK_INCDEC_MODELVAR_ZERO(event, moduleData.channelsStart, 32-8-moduleData.channelsCount);
@@ -1060,9 +1060,6 @@ void menuModelSetup(event_t event)
#endif
#if defined(PCBTARANIS) || defined(PCBI6X)
case ITEM_MODEL_INTERNAL_MODULE_BIND:
#endif
#if defined(PCBSKY9X)
case ITEM_MODEL_EXTRA_MODULE_BIND:
#endif
case ITEM_MODEL_EXTERNAL_MODULE_BIND:
{
@@ -1075,7 +1072,7 @@ void menuModelSetup(event_t event)
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, 'u');
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, (moduleData.ppm.delay*50)+300, RIGHT | ((CURSOR_ON_LINE() || menuHorizontalPosition==1) ? attr : 0));
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+10*FW, y, moduleData.ppm.pulsePol ? '+' : '-', (CURSOR_ON_LINE() || menuHorizontalPosition==2) ? attr : 0);
if (attr && (editMode>0 || p1valdiff)) {
if (attr && editMode > 0) {
switch (menuHorizontalPosition) {
case 0:
CHECK_INCDEC_MODELVAR(event, moduleData.ppm.frameLength, -20, 35);
@@ -1121,13 +1118,14 @@ void menuModelSetup(event_t event)
if (xOffsetBind)
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, g_model.header.modelId[moduleIdx], (l_posHorz==0 ? attr : 0) | LEADING0|LEFT, 2);
if (attr && l_posHorz == 0) {
if (editMode>0 || p1valdiff) {
if (editMode > 0) {
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.header.modelId[moduleIdx], MAX_RX_NUM(moduleIdx));
if (checkIncDec_Ret) {
if (isModuleCrossfire(moduleIdx))
moduleState[EXTERNAL_MODULE].counter = CRSF_FRAME_MODELID;
modelHeaders[g_eeGeneral.currModel].modelId[moduleIdx] = g_model.header.modelId[moduleIdx];
}
#if !defined(PCBI6X)
else if (event == EVT_KEY_LONG(KEY_ENTER)) {
killEvents(event);
uint8_t newVal = findNextUnusedModelId(g_eeGeneral.currModel, moduleIdx);
@@ -1136,6 +1134,7 @@ void menuModelSetup(event_t event)
storageDirty(EE_MODEL);
}
}
#endif
}
}
}
@@ -1158,8 +1157,6 @@ void menuModelSetup(event_t event)
if (isModuleR9M(moduleIdx) || (isModuleXJT(moduleIdx) && g_model.moduleData[moduleIdx].rfProtocol==RF_PROTO_X16)) {
#if defined(PCBXLITE)
if (EVT_KEY_MASK(event) == KEY_ENTER) {
#elif defined(PCBSKY9X) || defined(AR9X)
if (event == EVT_KEY_FIRST(KEY_ENTER)) {
#else
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
#endif
@@ -1225,16 +1222,6 @@ void menuModelSetup(event_t event)
break;
}
#if defined(PCBSKY9X) && defined(REVX)
case ITEM_MODEL_EXTERNAL_MODULE_OUTPUT_TYPE:
{
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
ModuleData & moduleData = g_model.moduleData[moduleIdx];
moduleData.ppm.outputType = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_OUTPUT_TYPE, STR_VOUTPUT_TYPE, moduleData.ppm.outputType, 0, 1, attr, event);
break;
}
#endif
#if defined(PCBTARANIS) || defined(PCBI6X)
case ITEM_MODEL_INTERNAL_MODULE_FAILSAFE:
#endif
@@ -1249,7 +1236,7 @@ void menuModelSetup(event_t event)
if (moduleData.failsafeMode != FAILSAFE_CUSTOM)
menuHorizontalPosition = 0;
if (menuHorizontalPosition == 0) {
if (editMode > 0 || p1valdiff) {
if (editMode > 0) {
CHECK_INCDEC_MODELVAR_ZERO(event, moduleData.failsafeMode, FAILSAFE_LAST);
if (checkIncDec_Ret) SEND_FAILSAFE_NOW(moduleIdx);
}
@@ -1400,60 +1387,13 @@ void menuModelSetup(event_t event)
break;
}
#endif
#if 0
case ITEM_MODEL_PPM2_PROTOCOL:
lcdDrawTextAlignedLeft(y, "Port2");
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, 0, 0);
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW+3, y, STR_CH, menuHorizontalPosition<=0 ? attr : 0);
lcdDrawNumber(lcdLastRightPos, y, g_model.moduleData[1].channelsStart+1, LEFT | (menuHorizontalPosition<=0 ? attr : 0));
lcdDrawChar(lcdLastRightPos, y, '-');
lcdDrawNumber(lcdLastRightPos + FW+1, y, g_model.moduleData[1].channelsStart+8+g_model.moduleData[1].channelsCount, LEFT | (menuHorizontalPosition!=0 ? attr : 0));
if (attr && (editMode>0 || p1valdiff)) {
switch (menuHorizontalPosition) {
case 0:
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.moduleData[1].channelsStart, 32-8-g_model.moduleData[1].channelsCount);
SET_DEFAULT_PPM_FRAME_LENGTH(1);
break;
case 1:
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].channelsCount, -4, min<int8_t>(8, 32-8-g_model.moduleData[1].channelsStart));
SET_DEFAULT_PPM_FRAME_LENGTH(1);
break;
}
}
break;
case ITEM_MODEL_PPM2_PARAMS:
lcdDrawTextAlignedLeft(y, STR_PPMFRAME);
lcdDrawText(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MS);
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)g_model.moduleData[1].ppmFrameLength*5 + 225, (menuHorizontalPosition<=0 ? attr : 0) | PREC1 | LEFT);
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, 'u');
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, (g_model.moduleData[1].ppmDelay*50)+300, RIGHT | ((menuHorizontalPosition < 0 || menuHorizontalPosition==1) ? attr : 0));
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+10*FW, y, g_model.moduleData[1].ppmPulsePol ? '+' : '-', (menuHorizontalPosition < 0 || menuHorizontalPosition==2) ? attr : 0);
if (attr && (editMode>0 || p1valdiff)) {
switch (menuHorizontalPosition) {
case 0:
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].ppmFrameLength, -20, 35);
break;
case 1:
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].ppmDelay, -4, 10);
break;
case 2:
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.moduleData[1].ppmPulsePol, 1);
break;
}
}
break;
#endif
}
}
#if defined(PXX) || defined(PCBI6X)
if (IS_RANGECHECK_ENABLE()) {
showMessageBox("RQly ");
lcdDrawNumber(16+4*FW, 5*FH, TELEMETRY_RSSI(), BOLD);
#if defined(AFHDS2A)
if (isModuleInRangeCheckMode()) {
showMessageBox("RQly");
lcdDrawNumber(WARNING_LINE_X, 5*FH, TELEMETRY_RSSI(), BOLD);
}
#endif
@@ -1461,21 +1401,17 @@ void menuModelSetup(event_t event)
if (old_editMode > 0 && s_editMode == 0) {
switch(menuVerticalPosition) {
#if defined(PCBTARANIS) || defined(PCBI6X)
case ITEM_MODEL_INTERNAL_MODULE_BIND:
case ITEM_MODEL_INTERNAL_MODULE_BIND + 1: // for some reason index is off by one
if (menuHorizontalPosition == 0)
checkModelIdUnique(g_eeGeneral.currModel, INTERNAL_MODULE);
break;
#endif
#if defined(PCBSKY9X)
case ITEM_MODEL_EXTRA_MODULE_BIND:
if (menuHorizontalPosition == 0)
checkModelIdUnique(g_eeGeneral.currModel, EXTRA_MODULE);
break;
#endif
#if !defined(PCBI6X)
case ITEM_MODEL_EXTERNAL_MODULE_BIND:
if (menuHorizontalPosition == 0)
checkModelIdUnique(g_eeGeneral.currModel, EXTERNAL_MODULE);
break;
#endif
}
}
}
@@ -1485,9 +1421,8 @@ void menuModelFailsafe(event_t event)
const uint8_t channelStart = g_model.moduleData[g_moduleIdx].channelsStart;
const int lim = (g_model.extendedLimits ? (512 * LIMIT_EXT_PERCENT / 100) : 512) * 2;
uint8_t wbar = LCD_W - FW * 4 - FWNUM * 4;
#if defined(PPM_UNIT_PERCENT_PREC1)
if (g_eeGeneral.ppmunit == PPM_PERCENT_PREC1)
wbar -= 6;
#endif
if (event == EVT_KEY_LONG(KEY_ENTER)) {
killEvents(event);
@@ -1561,13 +1496,7 @@ void menuModelFailsafe(event_t event)
failsafeValue = 0;
}
else {
#if defined(PPM_UNIT_US)
lcdDrawNumber(xValue, y, PPM_CH_CENTER(ch)+failsafeValue/2, RIGHT|flags);
#elif defined(PPM_UNIT_PERCENT_PREC1)
lcdDrawNumber(xValue, y, calcRESXto1000(failsafeValue), RIGHT|PREC1|flags);
#else
lcdDrawNumber(xValue, y, calcRESXto1000(failsafeValue)/10, RIGHT|flags);
#endif
drawChannelValue(xValue, y, ch, failsafeValue, RIGHT|flags);
}
// Gauge
@@ -24,11 +24,7 @@
#define MODEL_SPECIAL_FUNC_2ND_COLUMN (4*FW-1)
#define MODEL_SPECIAL_FUNC_3RD_COLUMN (15*FW-3)
#define MODEL_SPECIAL_FUNC_4TH_COLUMN (20*FW)
#if defined(GRAPHICS)
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (20*FW)
#else
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (18*FW+2)
#endif
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (20*FW)
#if defined(SDCARD)
void onCustomFunctionsFileSelectionMenu(const char * result)
@@ -61,8 +57,8 @@ void onCustomFunctionsFileSelectionMenu(const char * result)
POPUP_WARNING(func==FUNC_PLAY_SCRIPT ? STR_NO_SCRIPTS_ON_SD : STR_NO_SOUNDS_ON_SD);
}
}
else {
// The user choosed a file in the list
else if (result != STR_EXIT) {
// The user chosen a file in the list
memcpy(cfn->play.name, result, sizeof(cfn->play.name));
storageDirty(eeFlags);
}
@@ -95,7 +91,7 @@ void onAdjustGvarSourceLongEnterPress(const char * result)
CFN_PARAM(cfn) = 0;
storageDirty(EE_MODEL);
}
else {
else if (result != STR_EXIT) {
onSourceLongEnterPress(result);
}
}
@@ -115,19 +111,18 @@ void onCustomFunctionsMenu(const char * result)
eeFlags = EE_GENERAL;
}
#if defined(CLIPBOARD)
if (result == STR_COPY) {
#if defined(SDCARD)
clipboard.type = CLIPBOARD_TYPE_CUSTOM_FUNCTION;
clipboard.data.cfn = *cfn;
#endif
}
else if (result == STR_PASTE) {
#if defined(SDCARD)
*cfn = clipboard.data.cfn;
storageDirty(eeFlags);
#endif
}
else if (result == STR_CLEAR) {
else
#endif
if (result == STR_CLEAR) {
memset(cfn, 0, sizeof(CustomFunctionData));
storageDirty(eeFlags);
}
@@ -164,8 +159,8 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
#endif
killEvents(event);
CustomFunctionData *cfn = &functions[sub];
#if defined(CLIPBOARD)
if (!CFN_EMPTY(cfn))
#if !defined(PCBI6X)
POPUP_MENU_ADD_ITEM(STR_COPY);
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_FUNCTION && isAssignableFunctionAvailable(clipboard.data.cfn.func))
POPUP_MENU_ADD_ITEM(STR_PASTE);
@@ -187,15 +182,15 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
#endif
#endif // PCBTARANIS, PCBI6X
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i+menuVerticalOffset;
CustomFunctionData * cfn = &functions[k];
uint8_t func = CFN_FUNC(cfn);
for (uint8_t j=0; j<5; j++) {
for (uint32_t j=0; j<5; j++) {
uint8_t attr = ((sub==k && menuHorizontalPosition==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
uint8_t active = (attr && (s_editMode>0 || p1valdiff));
uint8_t active = (attr && s_editMode > 0);
switch (j) {
case 0:
if (sub==k && menuHorizontalPosition < 1 && CFN_SWITCH(cfn) == SWSRC_NONE) {
@@ -301,11 +296,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
}
#endif
else if (func == FUNC_SET_SCREEN) {
val_min = 0;
val_max = 4;
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
}
#if defined(HAPTIC)
else if (func == FUNC_HAPTIC) {
val_max = 3;
@@ -464,11 +454,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
else {
lcdDrawNumber(MODEL_SPECIAL_FUNC_4TH_COLUMN+2+FW, y, CFN_PLAY_REPEAT(cfn)*CFN_PLAY_REPEAT_MUL, RIGHT | attr);
}
if (active)
CFN_PLAY_REPEAT(cfn) = checkIncDec(event, CFN_PLAY_REPEAT(cfn)==CFN_PLAY_REPEAT_NOSTART?-1:CFN_PLAY_REPEAT(cfn),
-1,
(func == FUNC_SET_SCREEN ? 0 : 60/CFN_PLAY_REPEAT_MUL),
eeFlags);
if (active) CFN_PLAY_REPEAT(cfn) = checkIncDec(event, CFN_PLAY_REPEAT(cfn)==CFN_PLAY_REPEAT_NOSTART?-1:CFN_PLAY_REPEAT(cfn), -1, 60/CFN_PLAY_REPEAT_MUL, eeFlags);
}
else if (attr) {
REPEAT_LAST_CURSOR_MOVE();
+9 -15
View File
@@ -166,7 +166,7 @@ void menuModelSensor(event_t event)
int8_t sub = menuVerticalPosition;
for (uint8_t i=0; i<LCD_LINES-1; i++) {
for (uint32_t i=0; i<LCD_LINES-1; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i + menuVerticalOffset;
@@ -438,7 +438,7 @@ void menuModelTelemetryFrsky(event_t event)
break;
}
for (uint8_t i=0; i<LCD_LINES-1; i++) {
for (uint32_t i=0; i<LCD_LINES-1; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i + menuVerticalOffset;
for (int j=0; j<=k; j++) {
@@ -520,7 +520,7 @@ void menuModelTelemetryFrsky(event_t event)
break;
case ITEM_TELEMETRY_NEW_SENSOR:
lcdDrawText(0, y, STR_TELEMETRY_NEWSENSOR, attr);
lcdDrawText(INDENT_WIDTH, y, STR_TELEMETRY_NEWSENSOR, attr);
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
s_editMode = 0;
int res = availableTelemetryIndex();
@@ -551,19 +551,13 @@ void menuModelTelemetryFrsky(event_t event)
case ITEM_TELEMETRY_RSSI_LABEL:
#if defined(MULTIMODULE)
if (telemetryProtocol == PROTOCOL_MULTIMODULE &&
g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false) == MM_RF_PROTO_FS_AFHDS2A)
lcdDrawTextAlignedLeft(y, "RSNR");
else
#endif
lcdDrawTextAlignedLeft(y, "RQly");
break;
case ITEM_TELEMETRY_RSSI_ALARM1:
case ITEM_TELEMETRY_RSSI_ALARM2: {
bool warning = (k==ITEM_TELEMETRY_RSSI_ALARM1);
lcdDrawTextAlignedLeft(y, (warning ? STR_LOWALARM : STR_CRITICALALARM));
lcdDrawTextIndented(y, (warning ? STR_LOWALARM : STR_CRITICALALARM));
lcdDrawNumber(LCD_W, y, warning? g_model.rssiAlarms.getWarningRssi() : g_model.rssiAlarms.getCriticalRssi(), RIGHT | attr, 3);
if (attr && s_editMode>0) {
if (warning)
@@ -583,7 +577,7 @@ void menuModelTelemetryFrsky(event_t event)
break;
case ITEM_TELEMETRY_VARIO_SOURCE:
lcdDrawTextAlignedLeft(y, INDENT TR_SOURCE);
lcdDrawTextIndented(y, STR_SOURCE);
drawSource(TELEM_COL2, y, g_model.frsky.varioSource ? MIXSRC_FIRST_TELEM+3*(g_model.frsky.varioSource-1) : 0, attr);
if (attr) {
g_model.frsky.varioSource = checkIncDec(event, g_model.frsky.varioSource, 0, MAX_TELEMETRY_SENSORS, EE_MODEL|NO_INCDEC_MARKS, isSensorAvailable);
@@ -591,13 +585,13 @@ void menuModelTelemetryFrsky(event_t event)
break;
case ITEM_TELEMETRY_VARIO_RANGE:
lcdDrawTextAlignedLeft(y, STR_RANGE);
lcdDrawTextIndented(y, STR_RANGE);
if (attr && CURSOR_ON_LINE()) {
lcdDrawSolidFilledRect(TELEM_COL2-1, y-1, LCD_W-TELEM_COL2+1, FH+1);
}
lcdDrawNumber(TELEM_COL2, y, -10+g_model.frsky.varioMin, ((CURSOR_ON_LINE() || menuHorizontalPosition==0) ? attr : 0)|LEFT);
lcdDrawNumber(TELEM_COL2+4*FW, y, 10+g_model.frsky.varioMax, ((CURSOR_ON_LINE() || menuHorizontalPosition==1) ? attr : 0)|LEFT);
if (attr && (s_editMode>0 || p1valdiff)) {
if (attr && s_editMode > 0) {
switch (menuHorizontalPosition) {
case 0:
CHECK_INCDEC_MODELVAR(event, g_model.frsky.varioMin, -7, 7);
@@ -610,11 +604,11 @@ void menuModelTelemetryFrsky(event_t event)
break;
case ITEM_TELEMETRY_VARIO_CENTER:
lcdDrawTextAlignedLeft(y, STR_CENTER);
lcdDrawTextIndented(y, STR_CENTER);
lcdDrawNumber(TELEM_COL2, y, -5+g_model.frsky.varioCenterMin, ((CURSOR_ON_LINE() || menuHorizontalPosition==0) ? attr : 0)|PREC1|LEFT);
lcdDrawNumber(TELEM_COL2+4*FW, y, 5+g_model.frsky.varioCenterMax, ((CURSOR_ON_LINE() || menuHorizontalPosition==1) ? attr : 0)|PREC1|LEFT);
lcdDrawTextAtIndex(TELEM_COL2+8*FW, y, STR_VVARIOCENTER, g_model.frsky.varioCenterSilent, (menuHorizontalPosition==2 ? attr : 0));
if (attr && (s_editMode>0 || p1valdiff)) {
if (attr && s_editMode > 0) {
switch (menuHorizontalPosition) {
case 0:
CHECK_INCDEC_MODELVAR(event, g_model.frsky.varioCenterMin, -16, 5+min<int8_t>(10, g_model.frsky.varioCenterMax+5));
+1 -1
View File
@@ -40,7 +40,7 @@ void menuModelTemplates(event_t event)
coord_t y = MENU_HEADER_HEIGHT + 1;
uint8_t k = 0;
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
for (uint32_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
k = i+menuVerticalOffset;
lcdDrawNumber(3*FW, y, k, (sub==k ? INVERS : 0)|LEADING0, 2);
lcdDrawTextAtIndex(4*FW, y, STR_VTEMPLATES, k, (sub==k ? INVERS : 0));
+5 -4
View File
@@ -52,9 +52,9 @@ void drawAlertBox(const char * title, const char * text, const char * action)
{
lcdClear();
#if defined(PCBI6X_ELRS) && defined(TRANSLATIONS_PT) // saves ~140B
#if defined(DEBUG) || (defined(PCBI6X_ELRS) && defined(TRANSLATIONS_PT)) // saves ~140B
lcdDrawRect(2, 2, 32 - 4, 32 - 4);
lcdDrawText(11, 6, "x", DBLSIZE);
lcdDrawChar(11, 6, 'x', DBLSIZE);
#else
lcdDraw1bitBitmap(2, 0, ASTERISK_BITMAP, 0, 0);
#endif
@@ -88,7 +88,7 @@ void showAlertBox(const char * title, const char * text, const char * action , u
lcdRefresh();
lcdSetContrast();
clearKeyEvents();
waitKeysReleased();
resetBacklightTimeout();
checkBacklight();
}
@@ -98,9 +98,10 @@ void runPopupWarning(event_t event)
warningResult = false;
drawMessageBox();
if (warningInfoText) {
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, WARNING_INFO_FLAGS);
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, warningInfoFlags);
}
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+4*FH+2, warningType == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS_ENTER_EXIT);
switch (event) {
case EVT_KEY_BREAK(KEY_ENTER):
if (warningType == WARNING_TYPE_ASTERISK)
+121 -31
View File
@@ -21,6 +21,16 @@
#ifndef _POPUPS_H_
#define _POPUPS_H_
#include <inttypes.h>
#include "buzzer.h"
extern const char * warningText;
extern const char * warningInfoText;
extern uint8_t warningInfoLength;
extern uint8_t warningResult;
extern uint8_t warningType;
extern uint8_t warningInfoFlags;
#define MESSAGEBOX_X 8
#define MESSAGEBOX_Y 8
#define MESSAGEBOX_W (LCD_W - 15)
@@ -33,58 +43,138 @@
#define WARNING_LINE_X 12
#define WARNING_LINE_Y MESSAGEBOX_Y + 2
#define POPUP_MENU_MAX_LINES 12
#define MENU_MAX_DISPLAY_LINES 6
#define MENU_LINE_LENGTH (LEN_MODEL_NAME+12)
enum {
MENU_OFFSET_INTERNAL,
MENU_OFFSET_EXTERNAL
};
typedef void (* PopupFunc)(event_t event);
extern PopupFunc popupFunc;
extern uint8_t popupMenuOffsetType;
extern uint16_t popupMenuOffset;
extern const char * popupMenuItems[POPUP_MENU_MAX_LINES];
extern uint16_t popupMenuItemsCount;
typedef void (* PopupMenuHandler)(const char * result);
extern PopupMenuHandler popupMenuHandler;
extern const char * popupMenuTitle;
extern uint8_t popupMenuSelectedItem;
// Message box
void drawMessageBoxBackground(coord_t top, coord_t height);
void drawMessageBox();
void showMessageBox(const char * title);
// Popup menu
const char * runPopupMenu(event_t event);
void runPopupWarning(event_t event);
#define DRAW_MESSAGE_BOX(title) (warningText = title, drawMessageBox(), warningText = NULL)
extern void (*popupFunc)(event_t event);
extern uint8_t warningInfoFlags;
enum
{
WARNING_TYPE_WAIT,
WARNING_TYPE_INFO,
WARNING_TYPE_ASTERISK,
WARNING_TYPE_CONFIRM,
WARNING_TYPE_INPUT
};
#if !defined(GUI)
#define DISPLAY_WARNING(...)
#define POPUP_WARNING(...)
#define POPUP_CONFIRMATION(...)
#define POPUP_INPUT(...)
#define WARNING_INFO_FLAGS 0
#define SET_WARNING_INFO(...)
#else
#define DISPLAY_WARNING (*popupFunc)
#define POPUP_WARNING(s) (warningText = s, warningInfoText = 0, popupFunc = runPopupWarning)
#define POPUP_CONFIRMATION(s) (warningText = s, warningType = WARNING_TYPE_CONFIRM, warningInfoText = 0, popupFunc = runPopupWarning)
#define POPUP_INPUT(s, func) (warningText = s, popupFunc = func)
#define WARNING_INFO_FLAGS warningInfoFlags
#define SET_WARNING_INFO(info, len, flags) (warningInfoText = info, warningInfoLength = len, warningInfoFlags = flags)
#define DISPLAY_WARNING(evt) (*popupFunc)(evt)
// #define POPUP_CONFIRMATION(s) (warningText = s, warningType = WARNING_TYPE_CONFIRM, warningInfoText = 0, popupFunc = runPopupWarning)
// #define POPUP_INPUT(s, func) (warningText = s, popupFunc = func)
#endif
inline void POPUP_WARNING(const char * s)
{
// killAllEvents();
warningText = s;
warningInfoText = nullptr;
warningType = WARNING_TYPE_ASTERISK;
popupFunc = runPopupWarning;
}
inline void POPUP_CONFIRMATION(const char * s/*, PopupMenuHandler handler*/)
{
if (s != warningText) {
// killAllEvents();
warningText = s;
warningInfoText = nullptr;
warningType = WARNING_TYPE_CONFIRM;
popupFunc = runPopupWarning;
// popupMenuHandler = handler;
}
}
inline void POPUP_INPUT(const char * s, PopupFunc func)
{
// killAllEvents();
warningText = s;
warningInfoText = nullptr;
warningType = WARNING_TYPE_INPUT;
popupFunc = func;
}
inline void SET_WARNING_INFO(const char * info, uint8_t length, uint8_t flags)
{
warningInfoText = info;
warningInfoLength = length;
warningInfoFlags = flags;
}
inline bool isEventCaughtByPopup()
{
if (warningText /*&& warningType != WARNING_TYPE_WAIT*/)
return true;
if (popupMenuItemsCount > 0)
return true;
return false;
}
inline void POPUP_MENU_ADD_ITEM(const char * s)
{
popupMenuOffsetType = MENU_OFFSET_INTERNAL;
if (popupMenuItemsCount < POPUP_MENU_MAX_LINES) {
popupMenuItems[popupMenuItemsCount++] = s;
}
}
#if defined(SDCARD)
#define POPUP_MENU_ADD_SD_ITEM(s) POPUP_MENU_ADD_ITEM(s)
#else
#define POPUP_MENU_ADD_SD_ITEM(s)
#endif
#define NAVIGATION_MENUS
#define POPUP_MENU_ADD_ITEM(s) do { popupMenuOffsetType = MENU_OFFSET_INTERNAL; if (popupMenuItemsCount < POPUP_MENU_MAX_LINES) popupMenuItems[popupMenuItemsCount++] = s; } while (0)
#define POPUP_MENU_SELECT_ITEM(s) s_menu_item = (s > 0 ? (s < popupMenuItemsCount ? s : popupMenuItemsCount) : 0)
#define POPUP_MENU_START(func) do { popupMenuHandler = (func); AUDIO_KEY_PRESS(); } while (0)
#define POPUP_MENU_MAX_LINES 12
#define MENU_MAX_DISPLAY_LINES 6
#define MENU_LINE_LENGTH (LEN_MODEL_NAME+12)
inline void POPUP_MENU_SELECT_ITEM(uint8_t index)
{
popupMenuSelectedItem = (index > 0 ? (index < popupMenuItemsCount ? index : popupMenuItemsCount) : 0);
}
enum {
MENU_OFFSET_INTERNAL,
MENU_OFFSET_EXTERNAL
};
extern uint8_t popupMenuOffsetType;
extern uint8_t s_menu_item;
inline void POPUP_MENU_TITLE(const char * s)
{
popupMenuTitle = s;
}
inline void POPUP_MENU_START(PopupMenuHandler handler)
{
if (handler != popupMenuHandler) {
// killAllEvents();
AUDIO_KEY_PRESS();
popupMenuHandler = handler;
}
}
#if defined(NAVIGATION_MENUS)
extern uint16_t popupMenuOffset;
extern const char * popupMenuItems[POPUP_MENU_MAX_LINES];
extern uint16_t popupMenuItemsCount;
const char * runPopupMenu(event_t event);
extern void (*popupMenuHandler)(const char * result);
#endif
#endif // _POPUPS_H_
+4 -4
View File
@@ -33,7 +33,7 @@ enum CalibrationState {
void menuCommonCalib(event_t event)
{
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) { // get low and high vals for sticks and trims
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) { // get low and high vals for sticks and trims
int16_t vt = anaIn(i);
reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]);
reusableBuffer.calib.hiVals[i] = max(vt, reusableBuffer.calib.hiVals[i]);
@@ -101,7 +101,7 @@ void menuCommonCalib(event_t event)
// SET MIDPOINT
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
reusableBuffer.calib.loVals[i] = 15000;
reusableBuffer.calib.hiVals[i] = -15000;
#if defined(PCBTARANIS)
@@ -120,7 +120,7 @@ void menuCommonCalib(event_t event)
// MOVE STICKS/POTS
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
g_eeGeneral.calib[i].mid = reusableBuffer.calib.midVals[i];
int16_t v = reusableBuffer.calib.midVals[i] - reusableBuffer.calib.loVals[i];
@@ -133,7 +133,7 @@ void menuCommonCalib(event_t event)
case CALIB_STORE:
#if defined(PCBTARANIS)
for (uint8_t i=POT1; i<=POT_LAST; i++) {
for (uint32_t i=POT1; i<=POT_LAST; i++) {
int idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
if (IS_POT_MULTIPOS(i)) {
+1 -24
View File
@@ -24,17 +24,11 @@
void menuRadioDiagAnalogs(event_t event)
{
// TODO enum
#if defined(TX_CAPACITY_MEASUREMENT)
#define ANAS_ITEMS_COUNT 3
#elif defined(PCBSKY9X)
#define ANAS_ITEMS_COUNT 2
#else
#define ANAS_ITEMS_COUNT 1
#endif
SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, HEADER_LINE+ANAS_ITEMS_COUNT);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
#if (NUM_STICKS+NUM_POTS+NUM_SLIDERS) > 9
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH;
const uint8_t x_coord[] = {0, 70, 154};
@@ -51,23 +45,6 @@ void menuRadioDiagAnalogs(event_t event)
lcdDrawNumber(x+10*FW-1, y, (int16_t)calibratedAnalogs[CONVERT_MODE(i)]*25/256, RIGHT);
}
// RAS
#if defined(PCBTARANIS)
if (isModuleXJT(EXTERNAL_MODULE) && !IS_INTERNAL_MODULE_ON()) {
coord_t y = MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH + 1 * FH + 2;
lcdDrawText(1, y, "RAS:");
lcdDrawNumber(1 + 4*FW, y, telemetryData.swr.value, LEFT);
}
#else
if (isModuleXJT(EXTERNAL_MODULE)) {
coord_t y = MENU_HEADER_HEIGHT + 1 + ((NUM_STICKS+NUM_POTS+NUM_SLIDERS)/2)*FH;
uint8_t x = ((NUM_STICKS+NUM_POTS+NUM_SLIDERS) & 1) ? (LCD_W/2)+FW : 0;
lcdDrawText(x, y, "RAS:");
lcdDrawNumber(x + 4*FW, y, telemetryData.swr.value, LEFT);
}
#endif
#if (NUM_PWMSTICKS > 0) && !defined(SIMU)
lcdDrawTextAlignedLeft(7*FH, STICKS_PWM_ENABLED() ? "Sticks: PWM" : "Sticks: ANA");
#endif
+2 -2
View File
@@ -41,7 +41,7 @@ void menuRadioDiagKeys(event_t event)
lcdDrawText(14*FW, MENU_HEADER_HEIGHT+2*FH, STR_VTRIM);
for (uint8_t i=0; i<9; i++) {
for (uint32_t i=0; i<9; i++) {
coord_t y;
if (i < NUM_TRIMS_KEYS) {
@@ -87,7 +87,7 @@ void menuRadioDiagKeys(event_t event)
}
#if defined(ROTARY_ENCODER_NAVIGATION)
for (uint8_t i=0; i<DIM(rotencValue); i++) {
for (uint32_t i=0; i<DIM(rotencValue); i++) {
#if defined(PCBX7)
coord_t y = MENU_HEADER_HEIGHT + FH;
+35 -112
View File
@@ -20,83 +20,19 @@
#include "opentx.h"
#if defined(PCBSKY9X)
#define HW_SETTINGS_COLUMN (2+(15*FW))
enum MenuRadioHardwareItems {
ITEM_RADIO_HARDWARE_OPTREX_DISPLAY,
ITEM_RADIO_HARDWARE_STICKS_GAINS_LABELS,
ITEM_RADIO_HARDWARE_STICK_LV_GAIN,
ITEM_RADIO_HARDWARE_STICK_LH_GAIN,
ITEM_RADIO_HARDWARE_STICK_RV_GAIN,
ITEM_RADIO_HARDWARE_STICK_RH_GAIN,
IF_ROTARY_ENCODERS(ITEM_RADIO_HARDWARE_ROTARY_ENCODER)
CASE_BLUETOOTH(ITEM_RADIO_HARDWARE_BT_BAUDRATE)
ITEM_RADIO_HARDWARE_MAX
};
#define HW_SETTINGS_COLUMN1 30
#define HW_SETTINGS_COLUMN2 (HW_SETTINGS_COLUMN1 + 5*FW)
#define HW_SETTINGS_COLUMN3 HW_SETTINGS_COLUMN2 + FW
void menuRadioHardware(event_t event)
{
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, ITEM_RADIO_HARDWARE_MAX+1, {0, 0, (uint8_t)-1, 0, 0, 0, IF_ROTARY_ENCODERS(0) CASE_BLUETOOTH(0)});
uint8_t sub = menuVerticalPosition - 1;
for (uint8_t i=0; i<LCD_LINES-1; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i+menuVerticalOffset;
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
uint8_t attr = (sub == k ? blink : 0);
switch(k) {
case ITEM_RADIO_HARDWARE_OPTREX_DISPLAY:
g_eeGeneral.optrexDisplay = editChoice(HW_SETTINGS_COLUMN, y, STR_LCD, STR_VLCD, g_eeGeneral.optrexDisplay, 0, 1, attr, event);
break;
case ITEM_RADIO_HARDWARE_STICKS_GAINS_LABELS:
lcdDrawTextAlignedLeft(y, "Sticks");
break;
case ITEM_RADIO_HARDWARE_STICK_LV_GAIN:
case ITEM_RADIO_HARDWARE_STICK_LH_GAIN:
case ITEM_RADIO_HARDWARE_STICK_RV_GAIN:
case ITEM_RADIO_HARDWARE_STICK_RH_GAIN:
{
lcdDrawTextAtIndex(INDENT_WIDTH, y, "\002LVLHRVRH", k-ITEM_RADIO_HARDWARE_STICK_LV_GAIN, 0);
lcdDrawText(INDENT_WIDTH+3*FW, y, "Gain");
uint8_t mask = (1<<(k-ITEM_RADIO_HARDWARE_STICK_LV_GAIN));
uint8_t val = (g_eeGeneral.sticksGain & mask ? 1 : 0);
lcdDrawChar(HW_SETTINGS_COLUMN, y, val ? '2' : '1', attr);
if (attr) {
CHECK_INCDEC_GENVAR(event, val, 0, 1);
if (checkIncDec_Ret) {
g_eeGeneral.sticksGain ^= mask;
setSticksGain(g_eeGeneral.sticksGain);
}
}
break;
}
#if defined(ROTARY_ENCODERS)
case ITEM_RADIO_HARDWARE_ROTARY_ENCODER:
g_eeGeneral.rotarySteps = editChoice(HW_SETTINGS_COLUMN, y, "Rotary Encoder", "\0062steps4steps", g_eeGeneral.rotarySteps, 0, 1, attr, event);
break;
#if defined(BATTGRAPH)
#define CASE_BATTGRAPH(x) x,
#else
#define CASE_BATTGRAPH(x)
#endif
#if defined(BLUETOOTH)
case ITEM_RADIO_HARDWARE_BT_BAUDRATE:
g_eeGeneral.bluetoothBaudrate = editChoice(HW_SETTINGS_COLUMN, y, STR_BAUDRATE, "\005115k 9600 19200", g_eeGeneral.bluetoothBaudrate, 0, 2, attr, event);
if (attr && checkIncDec_Ret) {
btInit();
}
break;
#endif
}
}
}
#endif // PCBSKY9X
#if defined(PCBTARANIS) || defined(PCBI6X)
enum MenuRadioHardwareItems {
ITEM_RADIO_HARDWARE_LABEL_STICKS,
enum {
ITEM_RADIO_HARDWARE_LABEL_STICKS = 0,
ITEM_RADIO_HARDWARE_STICK1,
ITEM_RADIO_HARDWARE_STICK2,
ITEM_RADIO_HARDWARE_STICK3,
@@ -115,13 +51,8 @@ enum MenuRadioHardwareItems {
#if NUM_SWITCHES >= 6
ITEM_RADIO_HARDWARE_SH,
#endif
CASE_BATTGRAPH(ITEM_RADIO_HARDWARE_BATT_RANGE)
ITEM_RADIO_HARDWARE_BATTERY_CALIB,
#if defined(TX_CAPACITY_MEASUREMENT)
ITEM_RADIO_HARDWARE_CAPACITY_CALIB,
#endif
#if defined(PCBSKY9X)
ITEM_RADIO_HARDWARE_TEMPERATURE_CALIB,
#endif
ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE,
#if defined(BLUETOOTH)
ITEM_RADIO_HARDWARE_BLUETOOTH_MODE,
@@ -138,7 +69,7 @@ enum MenuRadioHardwareItems {
ITEM_RADIO_HARDWARE_DEBUG,
#endif
#if defined(EEPROM_RLC)
#if !defined(PCBI6X)
#if defined(SDCARD)
ITEM_RADIO_BACKUP_EEPROM,
#endif
ITEM_RADIO_FACTORY_RESET,
@@ -169,17 +100,12 @@ enum MenuRadioHardwareItems {
#else
#define BLUETOOTH_ROWS
#endif
#if defined(PCBXLITE)
#if defined(PCBXLITE) || defined(PCBI6X)
#define SWITCH_TYPE_MAX(sw) (SWITCH_3POS)
#elif defined(PCBI6X)
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SC-MIXSRC_FIRST_SWITCH == sw) ? SWITCH_3POS : SWITCH_2POS)
#else
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SF-MIXSRC_FIRST_SWITCH == sw || MIXSRC_SH-MIXSRC_FIRST_SWITCH == sw) ? SWITCH_2POS : SWITCH_3POS)
#endif
#define HW_SETTINGS_COLUMN1 30
#define HW_SETTINGS_COLUMN2 (30 + 5*FW)
#if defined(EEPROM_RLC)
void onFactoryResetConfirm(const char result)
{
@@ -205,13 +131,8 @@ void menuRadioHardware(event_t event)
POTS_ROWS,
LABEL(Switches),
SWITCHES_ROWS,
CASE_BATTGRAPH(1)
0 /* battery calib */,
#if defined(TX_CAPACITY_MEASUREMENT)
0,
#endif
#if defined(PCBSKY9X)
0,
#endif
#if defined(CROSSFIRE)
0 /* max bauds */,
#endif
@@ -226,7 +147,7 @@ void menuRadioHardware(event_t event)
uint8_t sub = menuVerticalPosition - HEADER_LINE;
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i+menuVerticalOffset;
for (int j=0; j<=k; j++) {
@@ -304,22 +225,24 @@ void menuRadioHardware(event_t event)
break;
}
case ITEM_RADIO_HARDWARE_BATTERY_CALIB:
#if defined(PCBTARANIS) || defined(PCBI6X)
lcdDrawTextAlignedLeft(y, STR_BATT_CALIB);
putsVolts(HW_SETTINGS_COLUMN2, y, getBatteryVoltage(), attr|PREC2|LEFT);
#elif defined(PCBSKY9X)
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+1+4*FH, STR_BATT_CALIB);
static int32_t adcBatt;
// TODO board.cpp
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.txVoltageCalibration)/128) * 4191;
batCalV /= 55296;
putsVolts(HW_SETTINGS_COLUMN2, y, batCalV, (menuVerticalPosition==HEADER_LINE ? INVERS : 0));
#else
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH, STR_BATT_CALIB);
putsVolts(HW_SETTINGS_COLUMN2, y, g_vbat100mV, attr|LEFT);
#if defined(BATTGRAPH)
case ITEM_RADIO_HARDWARE_BATT_RANGE:
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
putsVolts(HW_SETTINGS_COLUMN3, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|NO_UNIT);
lcdDrawChar(lcdNextPos, y, '-');
putsVolts(lcdNextPos, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|NO_UNIT);
if (attr && s_editMode>0) {
if (menuHorizontalPosition==0)
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -60, g_eeGeneral.vBatMax+29); // min=3.0V
else
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMax, g_eeGeneral.vBatMin-29, +40); // max=16.0V
}
break;
#endif
case ITEM_RADIO_HARDWARE_BATTERY_CALIB:
lcdDrawTextAlignedLeft(y, STR_BATT_CALIB);
putsVolts(HW_SETTINGS_COLUMN3, y, getBatteryVoltage(), attr|PREC2|LEFT);
if (attr) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
}
@@ -327,7 +250,7 @@ void menuRadioHardware(event_t event)
#if defined(CROSSFIRE)
case ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE:
g_eeGeneral.telemetryBaudrate = editChoice(HW_SETTINGS_COLUMN2, y, STR_MAXBAUDRATE, "\004400k115k921k1.8M", g_eeGeneral.telemetryBaudrate, 0, DIM(CROSSFIRE_BAUDRATES) - 1, attr, event);
g_eeGeneral.telemetryBaudrate = editChoice(HW_SETTINGS_COLUMN2, y, STR_MAXBAUDRATE, "\005400k 115k 921k 1.87M3.75M5.25M", g_eeGeneral.telemetryBaudrate, 0, DIM(CROSSFIRE_BAUDRATES) - 1, attr, event);
if (attr) {
storageDirty(EE_GENERAL);
if (checkIncDec_Ret && IS_EXTERNAL_MODULE_ON()) {
@@ -374,15 +297,15 @@ void menuRadioHardware(event_t event)
}
break;
#endif // MENU_DIAG_ANAS_KEYS
#if !defined(PCBI6X)
#if defined(SDCARD)
case ITEM_RADIO_BACKUP_EEPROM:
lcdDrawText(0, y, BUTTON(STR_EEBACKUP), attr);
lcdDrawTextAlignedLeft(y, BUTTON(STR_EEBACKUP), attr);
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
s_editMode = EDIT_SELECT_FIELD;
eepromBackup();
}
break;
#endif // PCBI6X
#endif
case ITEM_RADIO_FACTORY_RESET:
onFactoryResetConfirm(warningResult);
if (LCD_W < 212)
+97 -134
View File
@@ -26,15 +26,13 @@ const unsigned char sticks[] = {
#include "sticks.lbm"
};
#define RADIO_SETUP_2ND_COLUMN (LCD_W-7*FW-3)
#define RADIO_SETUP_DATE_COLUMN (FW*15+7)
#define RADIO_SETUP_TIME_COLUMN (RADIO_SETUP_2ND_COLUMN + 2 * FWNUM)
#define RADIO_SETUP_2ND_COLUMN 79
#define SLIDER_5POS(y, value, label, event, attr) { \
int8_t tmp = value; \
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, nullptr, tmp, -2, +2, attr, event); \
}
int8_t slider_5pos(coord_t y, int8_t value, event_t event, uint8_t attr, const char* title)
{
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, 2+value, 4, attr);
return editChoice(RADIO_SETUP_2ND_COLUMN, y, title, nullptr, value, -2, +2, attr, event, INDENT_WIDTH);
}
#if defined(SPLASH)
#define CASE_SPLASH_PARAM(x) x,
@@ -42,16 +40,9 @@ const unsigned char sticks[] = {
#define CASE_SPLASH_PARAM(x)
#endif
#if defined(BATTGRAPH)
#define CASE_BATTGRAPH(x) x,
#else
#define CASE_BATTGRAPH(x)
#endif
enum MenuRadioSetupItems {
CASE_RTCLOCK(ITEM_SETUP_DATE)
CASE_RTCLOCK(ITEM_SETUP_TIME)
CASE_BATTGRAPH(ITEM_SETUP_BATT_RANGE)
ITEM_SETUP_SOUND_LABEL,
CASE_AUDIO(ITEM_SETUP_BEEP_MODE)
CASE_BUZZER(ITEM_SETUP_BUZZER_MODE)
@@ -70,11 +61,9 @@ enum MenuRadioSetupItems {
CASE_HAPTIC(ITEM_SETUP_HAPTIC_MODE)
CASE_HAPTIC(ITEM_SETUP_HAPTIC_LENGTH)
CASE_HAPTIC(ITEM_SETUP_HAPTIC_STRENGTH)
ITEM_SETUP_CONTRAST,
ITEM_SETUP_ALARMS_LABEL,
ITEM_SETUP_BATTERY_WARNING,
CASE_CAPACITY(ITEM_SETUP_CAPACITY_WARNING)
CASE_PCBSKY9X(ITEM_SETUP_TEMPERATURE_WARNING)
ITEM_SETUP_INACTIVITY_ALARM,
ITEM_SETUP_MEMORY_WARNING,
ITEM_SETUP_ALARM_WARNING,
@@ -89,6 +78,7 @@ enum MenuRadioSetupItems {
CASE_PWM_BACKLIGHT(ITEM_SETUP_BACKLIGHT_BRIGHTNESS_OFF)
CASE_PWM_BACKLIGHT(ITEM_SETUP_BACKLIGHT_BRIGHTNESS_ON)
ITEM_SETUP_FLASH_BEEP,
ITEM_SETUP_CONTRAST,
CASE_SPLASH_PARAM(ITEM_SETUP_DISABLE_SPLASH)
#if defined(PXX2)
ITEM_RADIO_OWNER_ID,
@@ -99,6 +89,7 @@ enum MenuRadioSetupItems {
CASE_PXX(ITEM_SETUP_COUNTRYCODE)
// ITEM_SETUP_LANGUAGE,
// ITEM_SETUP_IMPERIAL,
ITEM_SETUP_PPM,
IF_FAI_CHOICE(ITEM_SETUP_FAI)
ITEM_SETUP_SWITCHES_DELAY,
CASE_STM32(ITEM_SETUP_USB_MODE)
@@ -137,7 +128,7 @@ void menuRadioSetup(event_t event)
#endif
MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, HEADER_LINE+ITEM_SETUP_MAX, {
HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2) CASE_BATTGRAPH(1)
HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2)
LABEL(SOUND), CASE_AUDIO(0)
CASE_BUZZER(0)
/*0,*/ 0, 0, 0, CASE_DFPLAYER(0) CASE_AUDIO(0)
@@ -150,8 +141,7 @@ void menuRadioSetup(event_t event)
CASE_HAPTIC(0)
CASE_HAPTIC(0)
CASE_HAPTIC(0)
0, LABEL(ALARMS), 0, CASE_CAPACITY(0)
CASE_PCBSKY9X(0)
LABEL(ALARMS), 0, CASE_CAPACITY(0)
0, 0, 0,
#if defined(PWR_BUTTON_SOFT)
0, /* rssi poweroff alarm */
@@ -162,6 +152,7 @@ void menuRadioSetup(event_t event)
CASE_PWM_BACKLIGHT(0)
CASE_PWM_BACKLIGHT(0)
0, /* alarm */
0, // Contrast
CASE_SPLASH_PARAM(0)
#if defined(PXX2)
0 /* owner registration ID */,
@@ -171,6 +162,7 @@ void menuRadioSetup(event_t event)
CASE_GPS(0)
CASE_PXX(0)
/*0, 0,*/ /* voice language, imperial */
0, /* PPM Unit */
IF_FAI_CHOICE(0)
0,
CASE_STM32(0) // USB mode
@@ -183,7 +175,7 @@ void menuRadioSetup(event_t event)
uint8_t sub = menuVerticalPosition - HEADER_LINE;
for (uint8_t i=0; i<LCD_LINES-1; i++) {
for (uint32_t i=0; i<LCD_LINES-1; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i + menuVerticalOffset;
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
@@ -193,18 +185,18 @@ void menuRadioSetup(event_t event)
#if defined(RTCLOCK)
case ITEM_SETUP_DATE:
lcdDrawTextAlignedLeft(y, STR_DATE);
lcdDrawChar(RADIO_SETUP_DATE_COLUMN, y, '-');
lcdDrawChar(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, '-');
for (uint8_t j=0; j<3; j++) {
for (uint32_t j=0; j<3; j++) {
uint8_t rowattr = (menuHorizontalPosition==j ? attr : 0);
switch (j) {
case 0:
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN, y, t.tm_year+TM_YEAR_BASE, rowattr|RIGHT);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_year = checkIncDec(event, t.tm_year, 112, 200, 0);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, t.tm_year+TM_YEAR_BASE, rowattr|RIGHT);
lcdDrawChar(lcdNextPos, y, '-');
if (rowattr && s_editMode > 0) t.tm_year = checkIncDec(event, t.tm_year, 112, 200, 0);
break;
case 1:
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, t.tm_mon+1, rowattr|LEADING0|RIGHT, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mon = checkIncDec(event, t.tm_mon, 0, 11, 0);
lcdDrawNumber(lcdNextPos+3*FW-2, y, t.tm_mon+1, rowattr|LEADING0|RIGHT, 2);
lcdDrawChar(lcdNextPos, y, '-');
if (rowattr && s_editMode > 0) t.tm_mon = checkIncDec(event, t.tm_mon, 0, 11, 0);
break;
case 2:
{
@@ -212,8 +204,8 @@ void menuRadioSetup(event_t event)
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
static const uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += dmon[t.tm_mon];
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN+6*FW-4, y, t.tm_mday, rowattr|LEADING0|RIGHT, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
lcdDrawNumber(lcdNextPos+6*FW-4, y, t.tm_mday, rowattr|LEADING0|RIGHT, 2);
if (rowattr && s_editMode > 0) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
break;
}
}
@@ -225,21 +217,22 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_TIME:
lcdDrawTextAlignedLeft(y, STR_TIME);
lcdDrawChar(RADIO_SETUP_TIME_COLUMN+1, y, ':'); lcdDrawChar(RADIO_SETUP_TIME_COLUMN+3*FW-2, y, ':');
for (uint8_t j=0; j<3; j++) {
for (uint32_t j=0; j<3; j++) {
uint8_t rowattr = (menuHorizontalPosition==j ? attr : 0);
switch (j) {
case 0:
lcdDrawNumber(RADIO_SETUP_TIME_COLUMN, y, t.tm_hour, rowattr|LEADING0|RIGHT, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_hour = checkIncDec(event, t.tm_hour, 0, 23, 0);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, t.tm_hour, rowattr|LEADING0|RIGHT, 2);
lcdDrawChar(lcdNextPos + 1, y, ':');
if (rowattr && s_editMode > 0) t.tm_hour = checkIncDec(event, t.tm_hour, 0, 23, 0);
break;
case 1:
lcdDrawNumber(RADIO_SETUP_TIME_COLUMN+3*FWNUM, y, t.tm_min, rowattr|LEADING0|RIGHT, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_min = checkIncDec(event, t.tm_min, 0, 59, 0);
lcdDrawNumber(lcdNextPos + 1, y, t.tm_min, rowattr|LEADING0|RIGHT, 2);
lcdDrawChar(lcdNextPos + 1, y, ':');
if (rowattr && s_editMode > 0) t.tm_min = checkIncDec(event, t.tm_min, 0, 59, 0);
break;
case 2:
lcdDrawNumber(RADIO_SETUP_TIME_COLUMN+6*FWNUM, y, t.tm_sec, rowattr|LEADING0|RIGHT, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_sec = checkIncDec(event, t.tm_sec, 0, 59, 0);
lcdDrawNumber(lcdNextPos + 1, y, t.tm_sec, rowattr|LEADING0|RIGHT, 2);
if (rowattr && s_editMode > 0) t.tm_sec = checkIncDec(event, t.tm_sec, 0, 59, 0);
break;
}
}
@@ -249,47 +242,32 @@ void menuRadioSetup(event_t event)
break;
#endif
#if defined(BATTGRAPH)
case ITEM_SETUP_BATT_RANGE:
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
lcdDrawChar(lcdLastRightPos, y, '-');
putsVolts(lcdLastRightPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
if (attr && s_editMode>0) {
if (menuHorizontalPosition==0)
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -50, g_eeGeneral.vBatMax+29); // min=4.0V
else
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMax, g_eeGeneral.vBatMin-29, +40); // max=16.0V
}
break;
#endif
case ITEM_SETUP_SOUND_LABEL:
lcdDrawTextAlignedLeft(y, STR_SOUND_LABEL);
break;
#if defined(AUDIO)
case ITEM_SETUP_BEEP_MODE:
g_eeGeneral.beepMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
g_eeGeneral.beepMode = editChoice(LCD_W-2, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr|RIGHT, event, INDENT_WIDTH);
break;
#if defined(BUZZER) // AUDIO + BUZZER
case ITEM_SETUP_BUZZER_MODE:
g_eeGeneral.buzzerMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_BUZZER, STR_VBEEPMODE, g_eeGeneral.buzzerMode, -2, 1, attr, event);
g_eeGeneral.buzzerMode = editChoice(LCD_W-2, y, STR_BUZZER, STR_VBEEPMODE, g_eeGeneral.buzzerMode, -2, 1, attr|RIGHT, event, INDENT_WIDTH);
break;
#endif
#elif defined(BUZZER) // BUZZER only
case ITEM_SETUP_BUZZER_MODE:
g_eeGeneral.beepMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
g_eeGeneral.beepMode = editChoice(LCD_W-2, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr|RIGHT, event, INDENT_WIDTH);
break;
#endif
#if defined(VOICE)
case ITEM_SETUP_SPEAKER_VOLUME:
{
lcdDrawTextAlignedLeft(y, STR_SPEAKER_VOLUME);
lcdDrawTextIndented(y, STR_SPEAKER_VOLUME);
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
drawSlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, b, VOLUME_LEVEL_MAX, attr);
if (attr) {
CHECK_INCDEC_GENVAR(event, b, 0, VOLUME_LEVEL_MAX);
if (checkIncDec_Ret) {
@@ -301,29 +279,38 @@ void menuRadioSetup(event_t event)
#endif
case ITEM_SETUP_BEEP_VOLUME:
SLIDER_5POS(y, g_eeGeneral.beepVolume, STR_BEEP_VOLUME, event, attr);
g_eeGeneral.beepVolume = slider_5pos(y, g_eeGeneral.beepVolume, event, attr, STR_BEEP_VOLUME);
break;
#if defined(DFPLAYER)
case ITEM_SETUP_WAV_VOLUME:
SLIDER_5POS(y, g_eeGeneral.wavVolume, STR_WAV_VOLUME, event, attr);
dfplayerSetVolume(g_eeGeneral.wavVolume);
break;
{
int8_t vol = g_eeGeneral.wavVolume;
g_eeGeneral.wavVolume = slider_5pos(y, g_eeGeneral.wavVolume, event, attr, STR_WAV_VOLUME);
if (vol != g_eeGeneral.wavVolume) {
dfplayerSetVolume(g_eeGeneral.wavVolume);
}
}
break;
#endif
// case ITEM_SETUP_BACKGROUND_VOLUME:
// SLIDER_5POS(y, g_eeGeneral.backgroundVolume, STR_BG_VOLUME, event, attr);
// g_eeGeneral.backgroundVolume = slider_5pos(y, g_eeGeneral.backgroundVolume, event, attr, STR_BG_VOLUME);
// break;
case ITEM_SETUP_BEEP_LENGTH:
SLIDER_5POS(y, g_eeGeneral.beepLength, STR_BEEP_LENGTH, event, attr);
g_eeGeneral.beepLength = slider_5pos(y, g_eeGeneral.beepLength, event, attr, STR_BEEP_LENGTH);
break;
case ITEM_SETUP_SPEAKER_PITCH:
lcdDrawTextAlignedLeft( y, STR_SPKRPITCH);
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
{
lcdDrawTextIndented(y, STR_SPKRPITCH);
lcdDrawNumber(LCD_W-14, y, g_eeGeneral.speakerPitch*15, attr|RIGHT);
coord_t lp = lcdLastLeftPos - FW;
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
lcdDrawChar(lp, y, '+', attr);
if (attr) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
}
}
break;
@@ -332,23 +319,23 @@ void menuRadioSetup(event_t event)
lcdDrawTextAlignedLeft(y, STR_VARIO);
break;
case ITEM_SETUP_VARIO_VOLUME:
SLIDER_5POS(y, g_eeGeneral.varioVolume, TR_SPEAKER_VOLUME, event, attr);
g_eeGeneral.varioVolume = slider_5pos(y, g_eeGeneral.varioVolume, event, attr, TR_SPEAKER_VOLUME);
break;
case ITEM_SETUP_VARIO_PITCH:
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
lcdDrawTextIndented(y, STR_PITCH_AT_ZERO);
lcdDrawNumber(LCD_W-14, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|RIGHT);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
break;
case ITEM_SETUP_VARIO_RANGE:
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
lcdDrawTextIndented(y, STR_PITCH_AT_MAX);
lcdDrawNumber(LCD_W-14, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|RIGHT);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
break;
case ITEM_SETUP_VARIO_REPEAT:
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
lcdDrawTextIndented(y, STR_REPEAT_AT_ZERO);
lcdDrawNumber(LCD_W-14, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|RIGHT);
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
break;
@@ -360,21 +347,21 @@ void menuRadioSetup(event_t event)
break;
case ITEM_SETUP_HAPTIC_MODE:
g_eeGeneral.hapticMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, INDENT TR_MODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event);
g_eeGeneral.hapticMode = editChoice(LCD_W-2s, y, TR_MODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr|RIGHT, event);
break;
case ITEM_SETUP_HAPTIC_LENGTH:
SLIDER_5POS(y, g_eeGeneral.hapticLength, STR_LENGTH, event, attr);
g_eeGeneral.hapticLength = slider_5pos(y, g_eeGeneral.hapticLength, event, attr, STR_LENGTH);
break;
case ITEM_SETUP_HAPTIC_STRENGTH:
SLIDER_5POS(y, g_eeGeneral.hapticStrength, STR_HAPTICSTRENGTH, event, attr);
g_eeGeneral.hapticStrength = slider_5pos(y, g_eeGeneral.hapticStrength, event, attr, STR_HAPTICSTRENGTH);
break;
#endif
case ITEM_SETUP_CONTRAST:
lcdDrawTextAlignedLeft(y, STR_CONTRAST);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.contrast, attr|LEFT);
lcdDrawTextIndented(y, STR_CONTRAST);
lcdDrawNumber(LCD_W-2, y, g_eeGeneral.contrast, attr|RIGHT);
if (attr) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
lcdSetContrast();
@@ -386,52 +373,36 @@ void menuRadioSetup(event_t event)
break;
case ITEM_SETUP_BATTERY_WARNING:
lcdDrawTextAlignedLeft(y, STR_BATTERYWARNING);
putsVolts(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.vBatWarn, attr|LEFT);
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 35, 120); //3.5-12V
lcdDrawTextIndented(y, STR_BATTERYWARNING);
putsVolts(LCD_W-7, y, g_eeGeneral.vBatWarn, attr|RIGHT);
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 30, 120); //3.5-12V
break;
case ITEM_SETUP_MEMORY_WARNING:
{
uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event);
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, LCD_W-9, y, STR_MEMORYWARNING, attr, event, INDENT_WIDTH);
break;
}
case ITEM_SETUP_ALARM_WARNING:
{
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event);
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, LCD_W-9, y, STR_ALARMWARNING, attr, event, INDENT_WIDTH);
break;
}
#if defined(PWR_BUTTON_SOFT)
case ITEM_SETUP_RSSI_POWEROFF_ALARM:
{
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, LCD_W-9, y, STR_RSSISHUTDOWNALARM, attr, event, INDENT_WIDTH);
break;
}
#endif
#if defined(TX_CAPACITY_MEASUREMENT)
case ITEM_SETUP_CAPACITY_WARNING:
lcdDrawTextAlignedLeft(y, STR_CAPAWARNING);
drawValueWithUnit(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.mAhWarn*50, UNIT_MAH, attr|LEFT) ;
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.mAhWarn, 0, 100);
break;
#endif
#if defined(PCBSKY9X)
case ITEM_SETUP_TEMPERATURE_WARNING:
lcdDrawTextAlignedLeft(y, STR_TEMPWARNING);
drawValueWithUnit(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.temperatureWarn, UNIT_TEMPERATURE, attr|LEFT) ;
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.temperatureWarn, 0, 120); // 0 means no alarm
break;
#endif
case ITEM_SETUP_INACTIVITY_ALARM:
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
lcdDrawTextIndented(y, STR_INACTIVITYALARM);
lcdDrawNumber(LCD_W-7, y, g_eeGeneral.inactivityTimer, attr|RIGHT);
lcdDrawChar(lcdLastRightPos, y, 'm');
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
break;
@@ -450,22 +421,22 @@ void menuRadioSetup(event_t event)
break;
case ITEM_SETUP_BACKLIGHT_MODE:
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, INDENT TR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
g_eeGeneral.backlightMode = editChoice(LCD_W-2, y, TR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr|RIGHT, event, INDENT_WIDTH);
break;
case ITEM_SETUP_FLASH_BEEP:
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, RADIO_SETUP_2ND_COLUMN, y, STR_ALARM, attr, event ) ;
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, LCD_W-9, y, STR_ALARM, attr, event, INDENT_WIDTH);
break;
case ITEM_SETUP_BACKLIGHT_DELAY:
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
lcdDrawTextIndented(y, STR_BLDELAY);
lcdDrawNumber(LCD_W-7, y, g_eeGeneral.lightAutoOff*5, attr|RIGHT);
lcdDrawChar(lcdLastRightPos, y, 's');
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
break;
case ITEM_SETUP_BRIGHTNESS:
lcdDrawTextAlignedLeft(y, STR_BRIGHTNESS);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ;
lcdDrawTextIndented(y, STR_BRIGHTNESS);
lcdDrawNumber(LCD_W-2, y, 100-g_eeGeneral.backlightBright, attr|RIGHT) ;
if (attr) {
uint8_t b = 100 - g_eeGeneral.backlightBright;
CHECK_INCDEC_GENVAR(event, b, 0, 100);
@@ -509,7 +480,7 @@ void menuRadioSetup(event_t event)
#endif
#if defined(TELEMETRY_FRSKY) && defined(GPS)
#if !defined(PCBI6X)
#if defined(RTCLOCK)
case ITEM_SETUP_TIMEZONE:
lcdDrawTextAlignedLeft(y, STR_TIMEZONE);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
@@ -549,6 +520,10 @@ void menuRadioSetup(event_t event)
break;
#endif
case ITEM_SETUP_PPM:
g_eeGeneral.ppmunit = editChoice(LCD_W-2, y, STR_UNITS_PPM, "\004""0.--""0.0\0""us\0 ", g_eeGeneral.ppmunit, PPM_PERCENT_PREC0, PPM_US, attr|RIGHT, event);
break;
#if defined(FAI_CHOICE)
case ITEM_SETUP_FAI:
editCheckBox(g_eeGeneral.fai, RADIO_SETUP_2ND_COLUMN, y, "FAI Mode", attr, event);
@@ -564,45 +539,33 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_SWITCHES_DELAY:
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
lcdDrawNumber(LCD_W-14, y, 10*SWITCHES_DELAY(), attr|RIGHT);
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, 100-15);
break;
#if defined(STM32)
case ITEM_SETUP_USB_MODE:
g_eeGeneral.USBMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_USBMODE, STR_USBMODES, g_eeGeneral.USBMode, USB_UNSELECTED_MODE, USB_MAX_MODE, attr, event);
g_eeGeneral.USBMode = editChoice(LCD_W-2, y, STR_USBMODE, STR_USBMODES, g_eeGeneral.USBMode, USB_UNSELECTED_MODE, USB_MAX_MODE, attr|RIGHT, event);
break;
#endif
case ITEM_SETUP_RX_CHANNEL_ORD:
lcdDrawTextAlignedLeft(y, STR_RXCHANNELORD); // RAET->AETR
for (uint8_t i=1; i<=4; i++) {
putsChnLetter(RADIO_SETUP_2ND_COLUMN - FW + i*FW, y, channelOrder(i), attr);
for (uint32_t i=1; i<=4; i++) {
putsChnLetter(LCD_W - 2 - 5*FW + i*FW, y, channelOrder(i), attr);
}
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
break;
case ITEM_SETUP_STICK_MODE_LABELS:
lcdDrawTextAlignedLeft(y, STR_MODE);
for (uint8_t i=0; i<4; i++) {
for (uint32_t i=0; i<4; i++) {
lcdDraw1bitBitmap(5*FW+i*(4*FW+2), y, sticks, i, 0);
#if defined(FRSKY_STICKS) && !defined(PCBTARANIS)
if (g_eeGeneral.stickReverse & (1<<i)) {
lcdDrawFilledRect(5*FW+i*(4*FW+2), y, 3*FW, FH-1);
}
#endif
}
#if defined(FRSKY_STICKS) && !defined(PCBTARANIS)
if (attr) {
s_editMode = 0;
CHECK_INCDEC_GENVAR(event, g_eeGeneral.stickReverse, 0, 15);
lcdDrawRect(5*FW-1, y-1, 16*FW+2, 9);
}
#endif
break;
case ITEM_SETUP_STICK_MODE:
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
for (uint8_t i=0; i<NUM_STICKS; i++) {
for (uint32_t i=0; i<NUM_STICKS; i++) {
drawSource((5*FW-3)+i*(4*FW+2), y, MIXSRC_Rud + *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
}
if (attr && s_editMode>0) {
@@ -613,7 +576,7 @@ void menuRadioSetup(event_t event)
g_eeGeneral.stickMode = reusableBuffer.generalSettings.stickMode;
checkThrottleStick();
resumePulses();
clearKeyEvents();
waitKeysReleased();
}
break;
}
-19
View File
@@ -50,23 +50,4 @@ void menuRadioVersion(event_t event)
lcdDrawText(FW, y, vers_stamp, SMLSIZE);
y += 5 * (FH - 1);
#if defined(COPROCESSOR)
if (Coproc_valid == 1) {
lcdDrawTextAlignedLeft(y, "CoPr:");
lcdDraw8bitsNumber(10*FW, y, Coproc_read);
}
else {
lcdDrawTextAlignedLeft(y, "CoPr: ---");
}
y += FH;
#endif
#if defined(PXX2)
lcdDrawText(0, y, BUTTON("Modules / RX version"), menuVerticalPosition == ITEM_RADIO_MODULES_VERSION ? INVERS : 0);
y += FH;
if (menuVerticalPosition == ITEM_RADIO_MODULES_VERSION && event == EVT_KEY_BREAK(KEY_ENTER)) {
s_editMode = EDIT_SELECT_FIELD;
pushMenu(menuRadioModulesVersion);
}
#endif
}
+13 -27
View File
@@ -20,9 +20,9 @@
#include "opentx.h"
constexpr coord_t CHANNEL_NAME_OFFSET = 1;
constexpr coord_t CHANNEL_VALUE_OFFSET = CHANNEL_NAME_OFFSET + 42;
constexpr coord_t CHANNEL_GAUGE_OFFSET = CHANNEL_VALUE_OFFSET;
constexpr coord_t CHANNEL_NAME_OFFSET = 0;
constexpr coord_t CHANNEL_VALUE_OFFSET = CHANNEL_NAME_OFFSET + 43;
constexpr coord_t CHANNEL_GAUGE_OFFSET = CHANNEL_VALUE_OFFSET - 1;
constexpr coord_t CHANNEL_BAR_WIDTH = 70;
constexpr coord_t CHANNEL_PROPERTIES_OFFSET = CHANNEL_GAUGE_OFFSET + CHANNEL_BAR_WIDTH + 2;
@@ -43,41 +43,35 @@ constexpr coord_t CHANNEL_PROPERTIES_OFFSET = CHANNEL_GAUGE_OFFSET + CHANNEL_BAR
#define EVT_KEY_PREVIOUS_PAGE EVT_KEY_BREAK(KEY_LEFT)
#endif
static bool mixersView = false;
void menuChannelsViewCommon(event_t event)
{
bool newLongNames = false;
uint8_t ch;
switch (event) {
case EVT_ENTRY:
memclear(&reusableBuffer.viewChannels, sizeof(reusableBuffer.viewChannels));
break;
case EVT_KEY_FIRST(KEY_ENTER):
reusableBuffer.viewChannels.mixersView = !reusableBuffer.viewChannels.mixersView;
mixersView = !mixersView;
break;
}
ch = 8 * (g_eeGeneral.view / ALTERNATE_VIEW);
// Screen title
lcdDrawText(LCD_W / 2, 0, reusableBuffer.viewChannels.mixersView ? STR_MIXERS_MONITOR : STR_CHANNELS_MONITOR, CENTERED);
lcdDrawText(LCD_W / 2, 0, mixersView ? STR_MIXERS_MONITOR : STR_CHANNELS_MONITOR, CENTERED);
lcdInvertLine(0);
int16_t limits = 512 * 2;
// Channels
for (uint8_t line = 0; line < 8; line++) {
for (uint32_t line = 0; line < 8; line++) {
LimitData * ld = limitAddress(ch);
const uint8_t y = 9 + line * 7;
const int32_t val = reusableBuffer.viewChannels.mixersView ? ex_chans[ch] : channelOutputs[ch];
const int32_t val = mixersView ? ex_chans[ch] : channelOutputs[ch];
const uint8_t lenLabel = ZLEN(g_model.limitData[ch].name);
// Channel name if present, number if not
if (lenLabel > 0) {
if (lenLabel > 4)
reusableBuffer.viewChannels.longNames = true;
lcdDrawSizedText(CHANNEL_NAME_OFFSET, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
}
else {
@@ -85,18 +79,12 @@ void menuChannelsViewCommon(event_t event)
}
// Value
#if defined(PPM_UNIT_US)
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, PPM_CH_CENTER(ch) + val / 2, TINSIZE | RIGHT);
#elif defined(PPM_UNIT_PERCENT_PREC1)
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, calcRESXto1000(val), PREC1 | TINSIZE | RIGHT);
#else
lcdDrawNumber(CHANNEL_VALUE_OFFSET, y + 1, calcRESXto1000(val) / 10, TINSIZE | RIGHT);
#endif
drawChannelValue(CHANNEL_VALUE_OFFSET, y + 1, ch, val, TINSIZE | RIGHT);
// Gauge
drawGauge(CHANNEL_GAUGE_OFFSET, y, CHANNEL_BAR_WIDTH, 6, val, limits);
// Gauge
drawGauge(CHANNEL_GAUGE_OFFSET, y, CHANNEL_BAR_WIDTH, 6, val, limits);
if (!reusableBuffer.viewChannels.mixersView) {
if (!mixersView) {
// Properties
#if defined(OVERRIDE_CHANNEL_FUNCTION)
if (safetyCh[ch] != OVERRIDE_CHANNEL_UNDEFINED)
@@ -110,8 +98,6 @@ void menuChannelsViewCommon(event_t event)
++ch;
}
reusableBuffer.viewChannels.longNames = newLongNames;
}
void menuChannelsView(event_t event)
+6 -35
View File
@@ -107,7 +107,7 @@ void doMainScreenGraphics()
void displayTrims(uint8_t phase)
{
for (uint8_t i=0; i<4; i++) {
for (uint32_t i=0; i<4; i++) {
static coord_t x[4] = {TRIM_LH_X, TRIM_LV_X, TRIM_RV_X, TRIM_RH_X};
static uint8_t vert[4] = {0,1,1,0};
coord_t xm, ym;
@@ -191,7 +191,7 @@ void displayBattVoltage()
lcdDrawSolidFilledRect(VBATT_X-25, VBATT_Y+9, 21, 5);
lcdDrawSolidVerticalLine(VBATT_X-4, VBATT_Y+10, 3);
uint8_t count = GET_TXBATT_BARS();
for (uint8_t i=0; i<count; i+=2)
for (uint32_t i=0; i<count; i+=2)
lcdDrawSolidVerticalLine(VBATT_X-24+i, VBATT_Y+10, 3);
if (!IS_TXBATT_WARNING() || BLINK_ON_PHASE)
lcdDrawSolidFilledRect(VBATT_X-26, VBATT_Y, 24, 15);
@@ -202,22 +202,7 @@ void displayBattVoltage()
#endif
}
#if defined(PCBSKY9X)
void displayVoltageOrAlarm()
{
if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
drawValueWithUnit(6*FW-1, 2*FH, getTemperature(), UNIT_TEMPERATURE, BLINK|INVERS|DBLSIZE|RIGHT);
}
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.txCurrentCalibration)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
drawValueWithUnit(7*FW-1, 2*FH, (g_eeGeneral.mAhUsed + Current_used*(488 + g_eeGeneral.txCurrentCalibration)/8192/36)/10, UNIT_MAH, BLINK|INVERS|DBLSIZE|RIGHT);
}
else {
displayBattVoltage();
}
}
#else
#define displayVoltageOrAlarm() displayBattVoltage()
#endif
#define displayVoltageOrAlarm() displayBattVoltage()
#if defined(PCBX7)
#define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER)
@@ -297,11 +282,6 @@ void onMainViewMenu(const char *result)
watchdogSuspend(200); // 2s
saveAllData();
}
#if defined(PCBI6X) && !defined(PCBI6X_USB_VBUS)
else if (result == STR_USBCONNECT) {
globalData.usbConnect = 1;
}
#endif
#if !defined(PCBI6X)
else if (result == STR_ABOUT_US) {
chainMenu(menuAboutView);
@@ -358,9 +338,6 @@ void menuMainView(event_t event)
POPUP_MENU_ADD_ITEM(STR_STATISTICS);
#if defined(PCBI6X) && !defined(PCBI6X_USB_VBUS)
POPUP_MENU_ADD_ITEM(STR_USBCONNECT);
#endif
#if !defined(PCBI6X)
POPUP_MENU_ADD_ITEM(STR_ABOUT_US);
#endif
@@ -437,7 +414,7 @@ void menuMainView(event_t event)
// scroll bar
lcdDrawHorizontalLine(38, 34, 54, DOTTED);
lcdDrawSolidHorizontalLine(38 + (g_eeGeneral.view / ALTERNATE_VIEW) * CHANNELS_SEGMENT_WIDTH, 34, CHANNELS_SEGMENT_WIDTH, SOLID);
for (uint8_t i=0; i<8; i++) {
for (uint32_t i=0; i<8; i++) {
uint8_t x0, y0;
uint8_t chan = 8 * (g_eeGeneral.view / ALTERNATE_VIEW) + i;
int16_t val = channelOutputs[chan];
@@ -445,13 +422,7 @@ void menuMainView(event_t event)
if (view_base == VIEW_OUTPUTS_VALUES) {
x0 = (i % 4 * 9 + 3) * FW / 2;
y0 = i / 4 * FH + 40;
#if defined(PPM_UNIT_US)
lcdDrawNumber(x0 + 4 * FW, y0, PPM_CH_CENTER(chan) + val / 2, RIGHT);
#elif defined(PPM_UNIT_PERCENT_PREC1)
lcdDrawNumber(x0 + 4 * FW, y0, calcRESXto1000(val), RIGHT | PREC1);
#else
lcdDrawNumber(x0+4*FW , y0, calcRESXto1000(val)/10, RIGHT); // G: Don't like the decimal part*
#endif
drawChannelValue(x0 + 4 * FW, y0, chan, val, RIGHT);
}
else {
constexpr coord_t WBAR2 = (50/2);
@@ -533,7 +504,7 @@ void menuMainView(event_t event)
}
#else
// The ID0 3-POS switch is merged with the TRN switch
for (uint8_t i=SWSRC_THR; i<=SWSRC_TRN; i++) {
for (uint32_t i=SWSRC_THR; i<=SWSRC_TRN; i++) {
int8_t sw = (i == SWSRC_TRN ? (switchState(SW_ID0) ? SWSRC_ID0 : (switchState(SW_ID1) ? SWSRC_ID1 : SWSRC_ID2)) : i);
uint8_t x = 2*FW-2, y = i*FH+1;
if (i >= SWSRC_AIL) {
+11 -35
View File
@@ -50,7 +50,7 @@ void menuStatisticsView(event_t event)
#if !defined(PCBTARANIS)
case EVT_KEY_LONG(KEY_MENU): // historical
#endif
#if !defined(PCBSKY9X) && !defined(PCBI6X)
#if !defined(PCBI6X)
case EVT_KEY_LONG(KEY_ENTER):
#endif
g_eeGeneral.globalTimer = 0;
@@ -120,10 +120,6 @@ void menuStatisticsDebug(event_t event)
switch (event) {
case EVT_KEY_LONG(KEY_ENTER):
#if defined(PCBSKY9X)
g_eeGeneral.mAhUsed = 0;
Current_used = 0;
#endif
g_eeGeneral.globalTimer = 0;
sessionTimer = 0;
storageDirty(EE_GENERAL);
@@ -163,34 +159,6 @@ void menuStatisticsDebug(event_t event)
// lcdDrawNumber(MENU_DEBUG_COL1_OFS + FW, MENU_DEBUG_ROW1, telemetryErrors, RIGHT);
#endif
#if defined(PCBSKY9X)
if ((ResetReason&RSTC_SR_RSTTYP) == (2<<8)) {
lcdDrawText(LCD_W-8*FW, 0*FH, "WATCHDOG");
}
else if (globalData.unexpectedShutdown) {
lcdDrawText(LCD_W-13*FW, 0*FH, "UNEXP.SHTDOWN");
}
#endif
#if defined(TX_CAPACITY_MEASUREMENT)
// current
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_CURRENT, STR_CPU_CURRENT);
drawValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_CURRENT, getCurrent(), UNIT_MILLIAMPS, LEFT);
uint32_t current_scale = 488 + g_eeGeneral.txCurrentCalibration;
lcdDrawChar(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_CURRENT, '>');
drawValueWithUnit(MENU_DEBUG_COL2_OFS+FW+1, MENU_DEBUG_Y_CURRENT, Current_max*10*current_scale/8192, UNIT_RAW, LEFT);
// consumption
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MAH, STR_CPU_MAH);
drawValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MAH, g_eeGeneral.mAhUsed + Current_used*current_scale/8192/36, UNIT_MAH, LEFT|PREC1);
#endif
#if defined(PCBSKY9X)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_CPU_TEMP, STR_CPU_TEMP);
drawValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_CPU_TEMP, getTemperature(), UNIT_TEMPERATURE, LEFT);
lcdDrawChar(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_CPU_TEMP, '>');
drawValueWithUnit(MENU_DEBUG_COL2_OFS+FW+1, MENU_DEBUG_Y_CPU_TEMP, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_TEMPERATURE, LEFT);
#endif
#if defined(COPROCESSOR)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_COPROC, STR_COPROC_TEMP);
@@ -232,6 +200,14 @@ void menuStatisticsDebug(event_t event)
#endif // LUA
#endif // PCBTARANIS
// lcdDrawTextAlignedLeft(MENU_DEBUG_Y_COPROC, "Stack");
// lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, stackAvailable(), LEFT);
// lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_COPROC, "/");
// lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_COPROC, stackSize() * 4, LEFT);
// lcdDrawTextAlignedLeft(MENU_DEBUG_Y_COPROC, "USB Conn");
// lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, ((GPIOA->IDR & GPIO_IDR_11) ? 1 : 0), LEFT);
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_MIXMAX, "ms");
@@ -239,10 +215,10 @@ void menuStatisticsDebug(event_t event)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
#if defined(AUDIO)
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
#endif
lcdDrawText(4*FW, 7*FH+1, STR_MENUTORESET);
+2 -19
View File
@@ -21,12 +21,10 @@
#include "opentx.h"
#define STATUS_BAR_Y (7*FH+1)
#define TELEM_2ND_COLUMN (10*FW)
#if defined(TELEMETRY_FRSKY)
uint8_t selectedTelemView = 0;
#endif
#define BAR_LEFT 25
#define BAR_WIDTH 100
@@ -43,7 +41,7 @@ void displayRssiLine()
lcdDrawFilledRect(66+36-v, 58, v, 5, (rssi < g_model.rssiAlarms.getWarningRssi()) ? DOTTED : SOLID);
}
else {
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
lcdDrawText(LCD_W/2, STATUS_BAR_Y, STR_NODATA, BLINK|CENTERED);
lcdInvertLastLine();
}
}
@@ -103,7 +101,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
// Custom Screen with numbers
uint8_t fields_count = 0;
lcdDrawSolidVerticalLine(63, 8, 48);
for (uint8_t i=0; i<4; i++) {
for (uint32_t i=0; i<4; i++) {
for (uint8_t j=0; j<NUM_LINE_ITEMS; j++) {
source_t field = screen.lines[i].sources[j];
if (field > 0) {
@@ -287,20 +285,5 @@ void menuViewTelemetry(event_t event)
#endif
}
void showTelemScreen(uint8_t index)
{
if (menuHandlers[menuLevel] == menuViewTelemetry || menuHandlers[menuLevel] == menuMainView) {
if (index == 0) {
chainMenu(menuMainView);
} else {
index -= 1;
if ((/*index >= 0 &&*/ index <= TELEMETRY_SCREEN_TYPE_MAX) && (TELEMETRY_SCREEN_TYPE(index) != TELEMETRY_SCREEN_TYPE_NONE)) {
selectedTelemView = index;
chainMenu(menuViewTelemetry);
}
}
}
}
#undef EVT_KEY_PREVIOUS_VIEW
#undef EVT_KEY_NEXT_VIEW
+47 -19
View File
@@ -34,17 +34,12 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval)
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
{
#if defined(GRAPHICS)
if (value)
lcdDrawChar(x+1, y, '#');
if (attr)
lcdDrawSolidFilledRect(x, y, 7, 7);
else
lcdDrawSquare(x, y, 7);
#else
/* ON / OFF version */
lcdDrawTextAtIndex(x, y, STR_OFFON, value, attr ? INVERS:0) ;
#endif
}
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
@@ -85,39 +80,58 @@ void title(const char * s)
lcdDrawText(0, 0, s, INVERS);
}
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, coord_t lblX, IsValueAvailable isValueAvailable)
{
drawFieldLabel(x, y, label);
if (label) {
lcdDrawText(lblX, y, label);
}
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (menuVerticalPositions[0] == 0) ? EE_MODEL : EE_GENERAL);
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (menuVerticalPositions[0] == 0) ? EE_MODEL : EE_GENERAL, isValueAvailable);
return value;
}
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event )
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, coord_t lblX)
{
return editChoice(x, y, label, values, value, min, max, attr, event, lblX, nullptr);
}
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
{
return editChoice(x, y, label, values, value, min, max, attr, event, 0, nullptr);
}
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event, coord_t lblX)
{
#if defined(GRAPHICS)
drawCheckBox(x, y, value, attr);
return editChoice(x, y, label, NULL, value, 0, 1, attr, event);
#else
return editChoice(x, y, label, STR_OFFON, value, 0, 1, attr, event);
#endif
return editChoice(x, y, label, nullptr, value, 0, 1, attr, event, lblX);
}
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event)
{
return editCheckBox(value, x, y, label, attr, event, 0);
}
int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, event_t event)
{
drawFieldLabel(x, y, STR_SWITCH);
lcdDrawTextAlignedLeft(y, STR_SWITCH);
drawSwitch(x, y, value, attr);
if (attr & (~RIGHT)) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
return value;
}
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
void drawSlider(coord_t x, coord_t y, uint8_t width, uint8_t value, uint8_t max, uint8_t attr)
{
lcdDrawChar(x+(value*4*FW)/max, y, '$');
lcdDrawSolidHorizontalLine(x, y+3, 5*FW-1, FORCE);
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcdDrawSolidFilledRect(x, y, 5*FW-1, FH-1);
lcdDrawChar(x + (value * (width - FWNUM)) / max, y, '$');
lcdDrawSolidHorizontalLine(x, y + 3, width, FORCE);
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) {
lcdDrawSolidFilledRect(x, y, width, FH - 1);
}
}
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
{
drawSlider(x, y, 5*FW - 1, value, max, attr);
}
#if defined(GVARS)
void drawGVarValue(coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags)
@@ -261,6 +275,20 @@ void drawProgressBar(const char * label, int num, int den)
lcdRefresh();
}
void drawChannelValue(coord_t x, coord_t y, uint8_t ch, int16_t value, LcdFlags flags)
{
int16_t valueToDisplay;
if (g_eeGeneral.ppmunit == PPM_US) {
valueToDisplay = PPM_CH_CENTER(ch) + value / 2;
} else if (g_eeGeneral.ppmunit == PPM_PERCENT_PREC1) {
flags |= PREC1;
valueToDisplay = calcRESXto1000(value);
} else {
valueToDisplay = calcRESXto1000(value) / 10;
}
lcdDrawNumber(x, y, valueToDisplay, flags);
}
const unsigned char SLEEP_BITMAP[] = {
#include "sleep.lbm"
};
+1 -1
View File
@@ -122,7 +122,7 @@ uint8_t * lcdLoadBitmap(uint8_t * bmp, const char * filename, uint16_t width, ui
f_close(&bmpFile);
return NULL;
}
for (uint8_t i=0; i<16; i++) {
for (uint32_t i=0; i<16; i++) {
palette[i] = buf[4*i] >> 4;
}
}
-9
View File
@@ -47,11 +47,6 @@
#define MENUS_SCROLLBAR_WIDTH 2
inline void drawFieldLabel(coord_t x, coord_t y, const char * str)
{
lcdDrawText(0, y, str);
}
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
bool loadModelBitmap(char * name, uint8_t * bitmap);
@@ -254,10 +249,6 @@ void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay);
#define EDIT_DELAY(y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
#define WARNING_TYPE_ASTERISK 0
#define WARNING_TYPE_CONFIRM 1
#define WARNING_TYPE_INPUT 2
void copySelection(char * dst, const char * src, uint8_t size);
extern const char * warningText;
+2 -2
View File
@@ -725,7 +725,7 @@ void drawTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att
}
}
void drawValueWithUnit(coord_t x, coord_t y, int val, uint8_t unit, LcdFlags att)
void drawValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags att)
{
// convertUnit(val, unit);
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
@@ -922,7 +922,7 @@ void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
q += idx*w*hb;
for (uint8_t yb = 0; yb < hb; yb++) {
for (uint8_t i=0; i<w; i++) {
for (uint32_t i=0; i<w; i++) {
uint8_t b = *(q++);
uint8_t val = inv ? ~b : b;
for (int k=0; k<8; k++) {
+2 -2
View File
@@ -56,7 +56,7 @@ void runPopupCurvePreset(event_t event)
int8_t * points = curveAddress(s_curveChan);
int k = 25 * reusableBuffer.curveEdit.preset;
int dx = 2000 / (5+crv.points-1);
for (uint8_t i=0; i<5+crv.points; i++) {
for (uint32_t i=0; i<5+crv.points; i++) {
int x = -1000 + i * dx;
points[i] = div_and_round(div_and_round(k * x, 100), 10);
}
@@ -180,7 +180,7 @@ void menuModelCurveOne(event_t event)
uint8_t posY = FH+1;
attr = (s_editMode > 0 ? INVERS|BLINK : INVERS);
for (uint8_t i=0; i<5+crv.points; i++) {
for (uint32_t i=0; i<5+crv.points; i++) {
point_t point = getPoint(i);
uint8_t selectionMode = 0;
if (crv.type==CURVE_TYPE_CUSTOM) {
+1 -1
View File
@@ -61,7 +61,7 @@ void menuModelFlightModesAll(event_t event)
drawColumnHeader(STR_PHASES_HEADERS, posHorz);
}
for (uint8_t i=0; i<LCD_LINES-1; i++) {
for (uint32_t i=0; i<LCD_LINES-1; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i+menuVerticalOffset;
+2 -2
View File
@@ -91,13 +91,13 @@ void menuModelGVarOne(event_t event)
break;
case GVAR_FIELD_MIN:
lcdDrawText(0, y, STR_MIN);
lcdDrawTextAlignedLeft(y, STR_MIN);
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdx, GVAR_MIN+gvar->min, LEFT|attr);
if (attr) gvar->min = checkIncDec(event, GVAR_MIN+gvar->min, GVAR_MIN, GVAR_MAX-gvar->max, EE_MODEL) - GVAR_MIN;
break;
case GVAR_FIELD_MAX:
lcdDrawText(0, y, STR_MAX);
lcdDrawTextAlignedLeft(y, STR_MAX);
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdx, GVAR_MAX-gvar->max, LEFT|attr);
if (attr) gvar->max = GVAR_MAX - checkIncDec(event, GVAR_MAX-gvar->max, GVAR_MIN+gvar->min, GVAR_MAX, EE_MODEL);
break;
+1 -1
View File
@@ -135,7 +135,7 @@ void menuModelExpoOne(event_t event)
#if defined(FLIGHT_MODES)
case EXPO_FIELD_FLIGHT_MODES:
drawFieldLabel(EXPO_ONE_2ND_COLUMN, y, STR_FLMODE);
lcdDrawTextAlignedLeft(y, STR_FLMODE);
ed->flightModes = editFlightModes(EXPO_ONE_2ND_COLUMN, y, event, ed->flightModes, attr);
break;
#endif
@@ -98,7 +98,7 @@ void menuModelLogicalSwitches(event_t event)
POPUP_MENU_START(onLogicalSwitchesMenu);
}
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
for (uint32_t i=0; i<NUM_BODY_LINES; ++i) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
k = i+menuVerticalOffset;
LcdFlags attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
+4 -4
View File
@@ -70,13 +70,13 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
}
lcdDrawSolidVerticalLine(x+gaugeWidth/2-1, y, gaugeHeight+1);
if (barMin == -101) {
for (uint8_t i=0; i<3; ++i) {
for (uint32_t i=0; i<3; ++i) {
lcdDrawPoint(x+i, y+4-i);
lcdDrawPoint(x+3+i, y+4-i);
}
}
if (barMax == 101) {
for (uint8_t i=0; i<3; ++i) {
for (uint32_t i=0; i<3; ++i) {
lcdDrawPoint(x+gaugeWidth-8+i, y+4-i);
lcdDrawPoint(x+gaugeWidth-5+i, y+4-i);
}
@@ -145,7 +145,7 @@ void menuModelMixOne(event_t event)
#if defined(FLIGHT_MODES)
case MIX_FIELD_FLIGHT_MODE:
drawFieldLabel(MIXES_2ND_COLUMN, y, STR_FLMODE);
lcdDrawTextAlignedLeft(y, STR_FLMODE);
md2->flightModes = editFlightModes(MIXES_2ND_COLUMN, y, event, md2->flightModes, attr);
break;
#endif
@@ -155,7 +155,7 @@ void menuModelMixOne(event_t event)
break;
case MIX_FIELD_WARNING:
drawFieldLabel(MIXES_2ND_COLUMN, y, STR_MIXWARNING);
lcdDrawTextAlignedLeft(y, STR_MIXWARNING);
if (md2->mixWarn)
lcdDrawNumber(MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
else
+1 -1
View File
@@ -238,7 +238,7 @@ void menuModelSelect(event_t event)
TITLE(STR_MENUMODELSEL);
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i+menuVerticalOffset;
+5 -5
View File
@@ -430,7 +430,7 @@ void menuModelSetup(event_t event)
s_editMode = 0;
if (event==EVT_KEY_LONG(KEY_ENTER)) {
START_NO_HIGHLIGHT();
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
for (uint32_t i=0; i<MAX_FLIGHT_MODES; i++) {
memclear(&g_model.flightModeData[i], TRIMS_ARRAY_SIZE);
}
storageDirty(EE_MODEL);
@@ -838,7 +838,7 @@ void menuModelSetup(event_t event)
s_editMode = 0;
}
if (bluetoothDistantAddr[0]) {
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
lcdDrawTextIndented(y+1, bluetoothDistantAddr, TINSIZE);
if (bluetoothState != BLUETOOTH_STATE_CONNECTED) {
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Bind"), menuHorizontalPosition == 0 ? attr : 0);
lcdDrawText(MODEL_SETUP_2ND_COLUMN+5*FW, y, BUTTON("Clear"), menuHorizontalPosition == 1 ? attr : 0);
@@ -857,7 +857,7 @@ void menuModelSetup(event_t event)
}
}
else {
lcdDrawText(INDENT_WIDTH, y, "---");
lcdDrawTextIndented(y, "---");
if (bluetoothState < BLUETOOTH_STATE_IDLE)
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Init"), attr);
else
@@ -1108,7 +1108,7 @@ void menuModelSetup(event_t event)
const uint8_t multi_proto = g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(true);
const mm_protocol_definition *pdef = getMultiProtocolDefinition(multi_proto);
if (pdef->optionsstr)
lcdDrawText(INDENT_WIDTH, y, pdef->optionsstr);
lcdDrawTextIndented(y, pdef->optionsstr);
if (multi_proto == MM_RF_PROTO_FS_AFHDS2A)
optionValue = 50 + 5 * optionValue;
@@ -1201,7 +1201,7 @@ void menuModelSetup(event_t event)
}
#if defined(PXX)
if (IS_RANGECHECK_ENABLE()) {
if (isModuleInRangeCheckMode()) {
showMessageBox("RSSI: ");
lcdDrawNumber(16+4*FW, 5*FH, TELEMETRY_RSSI(), BOLD);
}
+2 -2
View File
@@ -133,7 +133,7 @@ void menuModelSensor(event_t event)
SUBMENU(STR_MENUSENSOR, SENSOR_FIELD_MAX, { 0, 0, sensor->type == TELEM_TYPE_CALCULATED ? (uint8_t)0 : (uint8_t)1, SENSOR_UNIT_ROWS, SENSOR_PREC_ROWS, SENSOR_PARAM1_ROWS, SENSOR_PARAM2_ROWS, SENSOR_PARAM3_ROWS, SENSOR_PARAM4_ROWS, SENSOR_AUTOOFFSET_ROWS, SENSOR_ONLYPOS_ROWS, SENSOR_FILTER_ROWS, SENSOR_PERSISTENT_ROWS, 0 });
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
int k = i + menuVerticalOffset;
@@ -403,7 +403,7 @@ void menuModelTelemetryFrsky(event_t event)
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY_FRSKY, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
int k = i + menuVerticalOffset;
for (int j=0; j<=k; j++) {
+2 -2
View File
@@ -79,7 +79,7 @@ void showAlertBox(const char * title, const char * text, const char * action, ui
AUDIO_ERROR_MESSAGE(sound);
lcdRefresh();
lcdSetContrast();
clearKeyEvents();
waitKeysReleased();
resetBacklightTimeout();
checkBacklight();
}
@@ -89,7 +89,7 @@ void runPopupWarning(event_t event)
drawMessageBox(warningText);
if (warningInfoText) {
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, WARNING_INFO_FLAGS);
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, warningInfoFlags);
}
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+2*FH, warningType == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS_ENTER_EXIT);
+2 -4
View File
@@ -31,7 +31,6 @@
void drawMessageBox(const char * title);
void showMessageBox(const char * title);
void runPopupWarning(event_t event);
#define DRAW_MESSAGE_BOX(title) drawMessageBox(title)
extern void (*popupFunc)(event_t event);
extern uint8_t warningInfoFlags;
@@ -40,11 +39,10 @@ extern uint8_t warningInfoFlags;
#define POPUP_WARNING(s) (warningText = s, warningInfoText = 0, popupFunc = runPopupWarning)
#define POPUP_CONFIRMATION(s) (warningText = s, warningType = WARNING_TYPE_CONFIRM, warningInfoText = 0, popupFunc = runPopupWarning)
#define POPUP_INPUT(s, func) (warningText = s, popupFunc = func)
#define WARNING_INFO_FLAGS warningInfoFlags
#define SET_WARNING_INFO(info, len, flags) (warningInfoText = info, warningInfoLength = len, warningInfoFlags = flags)
#define POPUP_MENU_ADD_ITEM(s) do { popupMenuOffsetType = MENU_OFFSET_INTERNAL; if (popupMenuItemsCount < POPUP_MENU_MAX_LINES) popupMenuItems[popupMenuItemsCount++] = s; } while (0)
#define POPUP_MENU_SELECT_ITEM(s) s_menu_item = (s > 0 ? (s < popupMenuItemsCount ? s : popupMenuItemsCount) : 0)
#define POPUP_MENU_SELECT_ITEM(s) popupMenuSelectedItem = (s > 0 ? (s < popupMenuItemsCount ? s : popupMenuItemsCount) : 0)
#define POPUP_MENU_START(func) do { popupMenuHandler = (func); AUDIO_KEY_PRESS(); } while (0)
#define POPUP_MENU_MAX_LINES 12
#define MENU_MAX_DISPLAY_LINES 6
@@ -59,7 +57,7 @@ enum {
MENU_OFFSET_EXTERNAL
};
extern uint8_t popupMenuOffsetType;
extern uint8_t s_menu_item;
extern uint8_t popupMenuSelectedItem;
const char * runPopupMenu(event_t event);
extern void (*popupMenuHandler)(const char * result);
+4 -4
View File
@@ -47,7 +47,7 @@ void drawPotsBars()
void menuCommonCalib(event_t event)
{
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) { // get low and high vals for sticks and trims
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) { // get low and high vals for sticks and trims
int16_t vt = anaIn(i);
reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]);
reusableBuffer.calib.hiVals[i] = max(vt, reusableBuffer.calib.hiVals[i]);
@@ -113,7 +113,7 @@ void menuCommonCalib(event_t event)
// SET MIDPOINT
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
reusableBuffer.calib.loVals[i] = 15000;
reusableBuffer.calib.hiVals[i] = -15000;
reusableBuffer.calib.midVals[i] = getAnalogValue(i) >> 1;
@@ -128,7 +128,7 @@ void menuCommonCalib(event_t event)
// MOVE STICKS/POTS
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
g_eeGeneral.calib[i].mid = reusableBuffer.calib.midVals[i];
int16_t v = reusableBuffer.calib.midVals[i] - reusableBuffer.calib.loVals[i];
@@ -140,7 +140,7 @@ void menuCommonCalib(event_t event)
break;
case CALIB_STORE:
for (uint8_t i=POT1; i<=POT_LAST; i++) {
for (uint32_t i=POT1; i<=POT_LAST; i++) {
int idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
if (IS_POT_MULTIPOS(i)) {
+1 -1
View File
@@ -24,7 +24,7 @@ void menuRadioDiagAnalogs(event_t event)
{
SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, 0);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
uint8_t x = i&1 ? LCD_W/2 + FW : 0;
lcdDrawNumber(x, y, i+1, LEADING0|LEFT, 2);
+1 -1
View File
@@ -32,7 +32,7 @@ void menuRadioDiagKeys(event_t event)
lcdDrawText(14*FW, MENU_HEADER_HEIGHT+2*FH, STR_VTRIM);
for (uint8_t i=0; i<9; i++) {
for (uint32_t i=0; i<9; i++) {
coord_t y;
if (i<8) {
+2 -2
View File
@@ -210,7 +210,7 @@ void menuRadioHardware(event_t event)
#if defined(BLUETOOTH)
case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE:
lcdDrawText(INDENT_WIDTH, y, STR_BLUETOOTH);
lcdDrawTextIndented(y, STR_BLUETOOTH);
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_BLUETOOTH_MODES, g_eeGeneral.bluetoothMode, attr);
if (attr) {
#if defined(USEHORUSBT)
@@ -222,7 +222,7 @@ void menuRadioHardware(event_t event)
break;
#if defined(USEHORUSBT)
case ITEM_RADIO_HARDWARE_BLUETOOTH_NAME:
lcdDrawText(INDENT_WIDTH, y, STR_NAME);
lcdDrawTextIndented(y, STR_NAME);
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.bluetoothName, LEN_BLUETOOTH_NAME, event, attr);
break;
#endif
+5 -5
View File
@@ -124,7 +124,7 @@ void menuRadioSetup(event_t event)
int sub = menuVerticalPosition;
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i + menuVerticalOffset;
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
@@ -477,7 +477,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_RX_CHANNEL_ORD:
lcdDrawTextAlignedLeft(y, STR_RXCHANNELORD); // RAET->AETR
for (uint8_t i=1; i<=4; i++) {
for (uint32_t i=1; i<=4; i++) {
putsChnLetter(RADIO_SETUP_2ND_COLUMN - FW + i*FW, y, channel_order(i), attr);
}
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
@@ -485,14 +485,14 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_STICK_MODE_LABELS:
lcdDrawTextAlignedLeft(y, STR_MODE);
for (uint8_t i=0; i<4; i++) {
for (uint32_t i=0; i<4; i++) {
lcdDraw1bitBitmap((6+4*i)*FW, y, sticks, i, 0);
}
break;
case ITEM_SETUP_STICK_MODE:
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
for (uint8_t i=0; i<4; i++) {
for (uint32_t i=0; i<4; i++) {
putsStickName((6+4*i)*FW, y, *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
}
if (attr && s_editMode>0) {
@@ -503,7 +503,7 @@ void menuRadioSetup(event_t event)
g_eeGeneral.stickMode = reusableBuffer.generalSettings.stickMode;
checkThrottleStick();
resumePulses();
clearKeyEvents();
waitKeysReleased();
}
break;
}

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