5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _DATACONSTANTS_H_
22 #define _DATACONSTANTS_H_
29 #define LUA_EXPORT(...) LEXP(__VA_ARGS__)
30 #define LUA_EXPORT_MULTIPLE(...) LEXP_MULTIPLE(__VA_ARGS__)
31 #define LUA_EXPORT_EXTRA(...) LEXP_EXTRA(__VA_ARGS__)
33 #define LUA_EXPORT(...)
34 #define LUA_EXPORT_MULTIPLE(...)
35 #define LUA_EXPORT_EXTRA(...)
40 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
41 #define MAX_FLIGHT_MODES 9
44 #define MAX_LOGICAL_SWITCHES 64
45 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
48 #define MAX_TRAINER_CHANNELS 16
49 #define MAX_TELEMETRY_SENSORS 60
50 #define MAX_CUSTOM_SCREENS 5
51 #elif defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E)
53 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
54 #define MAX_FLIGHT_MODES 9
57 #define MAX_LOGICAL_SWITCHES 64
58 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
61 #define MAX_TRAINER_CHANNELS 16
62 #define MAX_TELEMETRY_SENSORS 60
63 #elif defined(PCBTARANIS)
65 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
66 #define MAX_FLIGHT_MODES 9
69 #define MAX_LOGICAL_SWITCHES 64
70 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
73 #define MAX_TRAINER_CHANNELS 16
74 #define MAX_TELEMETRY_SENSORS 40
75 #elif defined(PCBSKY9X)
77 #define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
78 #define MAX_FLIGHT_MODES 9
81 #define MAX_LOGICAL_SWITCHES 64
82 #define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
84 #define MAX_TRAINER_CHANNELS 16
85 #define MAX_TELEMETRY_SENSORS 40
87 #warning "Unknown board!"
96 CURVE_TYPE_LAST
= CURVE_TYPE_CUSTOM
99 #define MIN_POINTS_PER_CURVE 3
100 #define MAX_POINTS_PER_CURVE 17
102 #if defined(PCBHORUS)
103 #define LEN_MODEL_NAME 15
104 #define LEN_TIMER_NAME 8
105 #define LEN_FLIGHT_MODE_NAME 10
106 #define LEN_BITMAP_NAME 14
107 #define LEN_EXPOMIX_NAME 6
108 #define LEN_CHANNEL_NAME 6
109 #define LEN_INPUT_NAME 4
110 #define LEN_CURVE_NAME 3
111 #define LEN_FUNCTION_NAME 6
112 #define MAX_CURVES 32
113 #define MAX_CURVE_POINTS 512
115 #define LEN_MODEL_NAME 12
116 #define LEN_TIMER_NAME 8
117 #define LEN_FLIGHT_MODE_NAME 10
118 #define LEN_BITMAP_NAME 10
119 #define LEN_EXPOMIX_NAME 6
120 #define LEN_CHANNEL_NAME 6
121 #define LEN_INPUT_NAME 4
122 #define LEN_CURVE_NAME 3
123 #define LEN_FUNCTION_NAME 8
124 #define MAX_CURVES 32
125 #define MAX_CURVE_POINTS 512
127 #define LEN_MODEL_NAME 10
128 #define LEN_TIMER_NAME 3
129 #define LEN_FLIGHT_MODE_NAME 6
130 #define LEN_EXPOMIX_NAME 6
131 #define LEN_CHANNEL_NAME 4
132 #define LEN_INPUT_NAME 3
133 #define LEN_CURVE_NAME 3
134 #define LEN_FUNCTION_NAME 6
135 #define MAX_CURVES 32
136 #define MAX_CURVE_POINTS 512
139 #if defined(PCBTARANIS) || defined(PCBSKY9X) || defined(PCBHORUS)
140 #define NUM_MODULES 2
142 #define NUM_MODULES 1
145 #define XPOTS_MULTIPOS_COUNT 6
147 #if defined(COLORLCD)
150 VIEW_TIMERS_ALTITUDE
,
182 #if defined(PCBTARANIS) || defined(PCBHORUS)
189 TRAINER_MODE_MASTER_TRAINER_JACK
,
191 #if defined(PCBTARANIS)
192 TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE
,
193 TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
,
194 TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
,
196 TRAINER_MODE_MASTER_BLUETOOTH
,
197 TRAINER_MODE_SLAVE_BLUETOOTH
,
200 #elif defined(PCBSKY9X)
208 #if defined(RADIO_T16)
209 #define TRAINER_MODE_MAX() TRAINER_MODE_MULTI
210 #elif defined(BLUETOOTH)
211 #define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
212 #elif defined(PCBX7) || defined(PCBXLITE)
213 #define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
215 #define TRAINER_MODE_MAX() HAS_WIRELESS_TRAINER_HARDWARE() ? TRAINER_MODE_MASTER_BATTERY_COMPARTMENT : TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
218 #if defined(HARDWARE_INTERNAL_MODULE)
219 #define IS_INTERNAL_MODULE_ENABLED() (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE)
221 #define IS_INTERNAL_MODULE_ENABLED() (false)
224 #define IS_EXTERNAL_MODULE_ENABLED() (g_model.moduleData[EXTERNAL_MODULE].type != MODULE_TYPE_NONE)
226 #if defined(HARDWARE_INTERNAL_MODULE)
227 #define IS_MODULE_ENABLED(moduleIdx) (moduleIdx==INTERNAL_MODULE ? IS_INTERNAL_MODULE_ENABLED() : moduleIdx==EXTERNAL_MODULE ? IS_EXTERNAL_MODULE_ENABLED() : false)
229 #define IS_MODULE_ENABLED(moduleIdx) (moduleIdx==EXTERNAL_MODULE ? IS_EXTERNAL_MODULE_ENABLED() : false)
233 #if defined(CLI) || defined(DEBUG)
238 UART_MODE_TELEMETRY_MIRROR
,
240 UART_MODE_SBUS_TRAINER
,
243 UART_MODE_MAX
= UART_MODE_COUNT
-1
246 #if defined(PCBHORUS)
247 #define LEN_SWITCH_NAME 3
248 #define LEN_ANA_NAME 3
249 #define LEN_MODEL_FILENAME 16
250 #define LEN_BLUETOOTH_NAME 10
252 #define LEN_SWITCH_NAME 3
253 #define LEN_ANA_NAME 3
254 #define LEN_BLUETOOTH_NAME 10
257 enum TelemetryProtocol
259 PROTOCOL_TELEMETRY_FIRST
,
260 PROTOCOL_TELEMETRY_FRSKY_SPORT
= PROTOCOL_TELEMETRY_FIRST
,
261 PROTOCOL_TELEMETRY_FRSKY_D
,
262 PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY
,
263 PROTOCOL_TELEMETRY_CROSSFIRE
,
264 PROTOCOL_TELEMETRY_SPEKTRUM
,
265 PROTOCOL_TELEMETRY_FLYSKY_IBUS
,
266 PROTOCOL_TELEMETRY_HITEC
,
267 PROTOCOL_TELEMETRY_HOTT
,
268 PROTOCOL_TELEMETRY_MULTIMODULE
,
269 PROTOCOL_TELEMETRY_LAST
=PROTOCOL_TELEMETRY_MULTIMODULE
,
270 PROTOCOL_TELEMETRY_LUA
273 #define TELEM_LABEL_LEN 4
280 UNIT_METERS_PER_SECOND
,
281 UNIT_FEET_PER_SECOND
,
283 UNIT_SPEED
= UNIT_KMH
,
286 UNIT_DIST
= UNIT_METERS
,
289 UNIT_TEMPERATURE
= UNIT_CELSIUS
,
302 UNIT_MILLILITERS_PER_MINUTE
,
303 UNIT_MAX
= UNIT_MILLILITERS_PER_MINUTE
,
317 // FrSky format used for these fields, could be another format in the future
319 UNIT_CELLS
= UNIT_FIRST_VIRTUAL
,
324 // Internal units (not stored in sensor unit)
328 UNIT_DATETIME_DAY_MONTH
,
329 UNIT_DATETIME_HOUR_MIN
,
334 #define NUM_LINE_ITEMS 3
336 #define NUM_LINE_ITEMS 2
339 #if defined(PCBTARANIS)
340 #define MAX_TELEM_SCRIPT_INPUTS 8
343 enum TelemetryScreenType
{
344 TELEMETRY_SCREEN_TYPE_NONE
,
345 TELEMETRY_SCREEN_TYPE_VALUES
,
346 TELEMETRY_SCREEN_TYPE_BARS
,
347 TELEMETRY_SCREEN_TYPE_SCRIPT
,
349 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_SCRIPT
351 TELEMETRY_SCREEN_TYPE_MAX
= TELEMETRY_SCREEN_TYPE_BARS
354 #define MAX_TELEMETRY_SCREENS 4
355 #define TELEMETRY_SCREEN_TYPE(screenIndex) TelemetryScreenType((g_model.screensType >> (2*(screenIndex))) & 0x03)
356 #define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_BARS)
358 constexpr int16_t FAILSAFE_CHANNEL_HOLD
= 2000;
359 constexpr int16_t FAILSAFE_CHANNEL_NOPULSE
= 2001;
361 #define LEN_SCRIPT_FILENAME 6
362 #define LEN_SCRIPT_NAME 6
363 #define MAX_SCRIPT_INPUTS 6
364 #define MAX_SCRIPT_OUTPUTS 6
372 #define LEN_GVAR_NAME 3
373 #define GVAR_MAX 1024
374 #define GVAR_MIN -GVAR_MAX
376 #define RESERVE_RANGE_FOR_GVARS 10
377 // even we do not spend space in EEPROM for 10 GVARS, we reserve the space inside the range of values, like offset, weight, etc.
386 #if defined(STORAGE_SWITCH_A)
387 SWSRC_SA0
= SWSRC_FIRST_SWITCH
,
392 #if defined(STORAGE_SWITCH_B)
398 #if defined(STORAGE_SWITCH_C)
404 #if defined(STORAGE_SWITCH_D)
410 #if defined(STORAGE_SWITCH_E)
416 #if defined(STORAGE_SWITCH_F)
422 #if defined(STORAGE_SWITCH_G)
428 #if defined(STORAGE_SWITCH_H)
434 #if defined(STORAGE_SWITCH_I)
440 #if defined(STORAGE_SWITCH_J)
446 #if defined(STORAGE_SWITCH_K)
452 #if defined(STORAGE_SWITCH_L)
458 #if defined(STORAGE_SWITCH_M)
464 #if defined(STORAGE_SWITCH_N)
470 #if defined(STORAGE_SWITCH_O)
476 #if defined(STORAGE_SWITCH_P)
482 #if defined(STORAGE_SWITCH_Q)
488 #if defined(STORAGE_SWITCH_R)
494 #if defined(PCBSKY9X)
495 SWSRC_ID0
= SWSRC_FIRST_SWITCH
,
504 SWSRC_TRAINER
= SWSRC_TRN
,
505 SWSRC_LAST_SWITCH
= SWSRC_TRN
,
507 SWSRC_LAST_SWITCH
= SWSRC_FIRST_SWITCH
+ STORAGE_NUM_SWITCHES_POSITIONS
- 1,
511 SWSRC_FIRST_MULTIPOS_SWITCH
,
512 SWSRC_LAST_MULTIPOS_SWITCH
= SWSRC_FIRST_MULTIPOS_SWITCH
+ (NUM_XPOTS
* XPOTS_MULTIPOS_COUNT
) - 1,
516 SWSRC_TrimRudLeft
= SWSRC_FIRST_TRIM
,
535 #if defined(PCBSKY9X)
539 SWSRC_FIRST_LOGICAL_SWITCH
,
540 SWSRC_SW1
= SWSRC_FIRST_LOGICAL_SWITCH
,
543 SWSRC_LAST_LOGICAL_SWITCH
= SWSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
548 SWSRC_FIRST_FLIGHT_MODE
,
549 SWSRC_LAST_FLIGHT_MODE
= SWSRC_FIRST_FLIGHT_MODE
+MAX_FLIGHT_MODES
-1,
551 SWSRC_TELEMETRY_STREAMING
,
554 SWSRC_LAST_SENSOR
= SWSRC_FIRST_SENSOR
+MAX_TELEMETRY_SENSORS
-1,
556 SWSRC_RADIO_ACTIVITY
,
558 #if defined(DEBUG_LATENCY)
559 SWSRC_LATENCY_TOGGLE
,
564 SWSRC_OFF
= -SWSRC_ON
,
566 SWSRC_LAST
= SWSRC_COUNT
-1,
567 SWSRC_FIRST
= -SWSRC_LAST
,
569 SWSRC_LAST_IN_LOGICAL_SWITCHES
= SWSRC_COUNT
-1,
570 SWSRC_LAST_IN_MIXES
= SWSRC_COUNT
-1,
572 SWSRC_FIRST_IN_LOGICAL_SWITCHES
= -SWSRC_LAST_IN_LOGICAL_SWITCHES
,
573 SWSRC_FIRST_IN_MIXES
= -SWSRC_LAST_IN_MIXES
,
575 SWSRC_INVERT
= SWSRC_COUNT
+1,
578 #if NUM_SWITCHES >= 8
579 #define SWSRC_TRAINER SWSRC_SH2
581 #define SWSRC_TRAINER SWSRC_LAST_SWITCH,
584 #define SWSRC_LAST_TRIM (SWSRC_FIRST_TRIM + 2*NUM_TRIMS - 1)
589 MIXSRC_FIRST_INPUT
, LUA_EXPORT_MULTIPLE("input", "Input [I%d]", MAX_INPUTS
)
590 MIXSRC_LAST_INPUT
= MIXSRC_FIRST_INPUT
+MAX_INPUTS
-1,
592 #if defined(LUA_INPUTS)
593 MIXSRC_FIRST_LUA
, LUA_EXPORT_MULTIPLE("lua", "Lua mix output %d", MAX_SCRIPTS
*MAX_SCRIPT_OUTPUTS
)
594 MIXSRC_LAST_LUA
= MIXSRC_FIRST_LUA
+(MAX_SCRIPTS
*MAX_SCRIPT_OUTPUTS
)-1,
598 MIXSRC_Rud
= MIXSRC_FIRST_STICK
, LUA_EXPORT("rud", "Rudder")
599 MIXSRC_Ele
, LUA_EXPORT("ele", "Elevator")
600 MIXSRC_Thr
, LUA_EXPORT("thr", "Throttle")
601 MIXSRC_Ail
, LUA_EXPORT("ail", "Aileron")
604 #if defined(PCBHORUS)
605 MIXSRC_S1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer S1")
606 MIXSRC_6POS
, LUA_EXPORT("6pos", "Multipos Switch")
607 MIXSRC_S2
, LUA_EXPORT("s2", "Potentiometer S2")
609 MIXSRC_EXT1
, LUA_EXPORT("ext1", "Ext 1")
610 MIXSRC_EXT2
, LUA_EXPORT("ext2", "Ext 2")
614 MIXSRC_S3
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("s3", "Slider S3")
615 MIXSRC_S4
, LUA_EXPORT("s4", "Slider S4")
616 MIXSRC_LS
, LUA_EXPORT("ls", "Left rear slider")
617 MIXSRC_RS
, LUA_EXPORT("rs", "Right rear slider")
619 MIXSRC_LS
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
620 MIXSRC_RS
, LUA_EXPORT("rs", "Right slider")
622 MIXSRC_LAST_POT
= MIXSRC_RS
,
623 #elif defined(PCBX9E)
624 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
625 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
626 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
627 MIXSRC_POT4
, LUA_EXPORT("s4", "Potentiometer 4 (X9E only)")
629 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
630 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
631 MIXSRC_SLIDER3
, LUA_EXPORT("lcs", "Left center slider (X9E only)")
632 MIXSRC_SLIDER4
, LUA_EXPORT("rcs", "Right center slider (X9E only)")
633 MIXSRC_LAST_POT
= MIXSRC_SLIDER4
,
634 #elif defined(PCBX7) || defined(PCBXLITE)
635 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
636 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
637 MIXSRC_LAST_POT
= MIXSRC_POT2
,
638 #elif defined(PCBX9LITE)
639 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
640 MIXSRC_LAST_POT
= MIXSRC_POT1
,
641 #elif defined(PCBTARANIS)
642 MIXSRC_POT1
= MIXSRC_FIRST_POT
, LUA_EXPORT("s1", "Potentiometer 1")
643 MIXSRC_POT2
, LUA_EXPORT("s2", "Potentiometer 2")
644 MIXSRC_POT3
, LUA_EXPORT("s3", "Potentiometer 3")
646 MIXSRC_SLIDER1
= MIXSRC_FIRST_SLIDER
, LUA_EXPORT("ls", "Left slider")
647 MIXSRC_SLIDER2
, LUA_EXPORT("rs", "Right slider")
648 MIXSRC_LAST_POT
= MIXSRC_SLIDER2
,
650 MIXSRC_P1
= MIXSRC_FIRST_POT
,
653 MIXSRC_LAST_POT
= MIXSRC_P3
,
656 #if defined(PCBHORUS)
657 MIXSRC_MOUSE1
, LUA_EXPORT("jsx", "Joystick X")
658 MIXSRC_MOUSE2
, LUA_EXPORT("jsy", "Joystick Y")
662 MIXSRC_GYRO1
, LUA_EXPORT("gyrx", "Gyro X")
663 MIXSRC_GYRO2
, LUA_EXPORT("gyry", "Gyro Y")
669 MIXSRC_CYC1
= MIXSRC_FIRST_HELI
, LUA_EXPORT("cyc1", "Cyclic 1")
670 MIXSRC_CYC2
, LUA_EXPORT("cyc2", "Cyclic 2")
671 MIXSRC_CYC3
, LUA_EXPORT("cyc3", "Cyclic 3")
674 MIXSRC_TrimRud
= MIXSRC_FIRST_TRIM
, LUA_EXPORT("trim-rud", "Rudder trim")
675 MIXSRC_TrimEle
, LUA_EXPORT("trim-ele", "Elevator trim")
676 MIXSRC_TrimThr
, LUA_EXPORT("trim-thr", "Throttle trim")
677 MIXSRC_TrimAil
, LUA_EXPORT("trim-ail", "Aileron trim")
678 #if defined(PCBHORUS)
679 MIXSRC_TrimT5
, LUA_EXPORT("trim-t5", "Aux trim T5")
680 MIXSRC_TrimT6
, LUA_EXPORT("trim-t6", "Aux trim T6")
681 MIXSRC_LAST_TRIM
= MIXSRC_TrimT6
,
683 MIXSRC_LAST_TRIM
= MIXSRC_TrimAil
,
688 #if defined(HARDWARE_SWITCH_A)
689 MIXSRC_SA
= MIXSRC_FIRST_SWITCH
, LUA_EXPORT("sa", "Switch A")
690 MIXSRC_SB
, LUA_EXPORT("sb", "Switch B")
691 MIXSRC_SC
, LUA_EXPORT("sc", "Switch C")
693 #if defined(HARDWARE_SWITCH_D)
694 MIXSRC_SD
, LUA_EXPORT("sd", "Switch D")
695 #elif defined(STORAGE_SWITCH_D)
698 #if defined(HARDWARE_SWITCH_E)
699 MIXSRC_SE
, LUA_EXPORT("se", "Switch E")
700 #elif defined(STORAGE_SWITCH_E)
703 #if defined(HARDWARE_SWITCH_F)
704 MIXSRC_SF
, LUA_EXPORT("sf", "Switch F")
705 #elif defined(STORAGE_SWITCH_F)
708 #if defined(HARDWARE_SWITCH_G)
709 MIXSRC_SG
, LUA_EXPORT("sg", "Switch G")
710 #elif defined(STORAGE_SWITCH_G)
713 #if defined(HARDWARE_SWITCH_H)
714 MIXSRC_SH
, LUA_EXPORT("sh", "Switch H")
715 #elif defined(STORAGE_SWITCH_H)
718 #if defined(HARDWARE_SWITCH_I)
719 MIXSRC_SI
, LUA_EXPORT("si", "Switch I")
720 #elif defined(STORAGE_SWITCH_I)
723 #if defined(HARDWARE_SWITCH_J)
724 MIXSRC_SJ
, LUA_EXPORT("sj", "Switch J")
725 #elif defined(STORAGE_SWITCH_J)
728 #if defined(HARDWARE_SWITCH_K)
729 MIXSRC_SK
, LUA_EXPORT("sk", "Switch K")
730 MIXSRC_SL
, LUA_EXPORT("sl", "Switch L")
731 MIXSRC_SM
, LUA_EXPORT("sm", "Switch M")
732 MIXSRC_SN
, LUA_EXPORT("sn", "Switch N")
733 MIXSRC_SO
, LUA_EXPORT("so", "Switch O")
734 MIXSRC_SP
, LUA_EXPORT("sp", "Switch P")
735 MIXSRC_SQ
, LUA_EXPORT("sq", "Switch Q")
736 MIXSRC_SR
, LUA_EXPORT("sr", "Switch R")
738 #if defined(PCBSKY9X)
739 MIXSRC_3POS
= MIXSRC_FIRST_SWITCH
,
747 MIXSRC_FIRST_LOGICAL_SWITCH
,
748 MIXSRC_SW1
= MIXSRC_FIRST_LOGICAL_SWITCH
, LUA_EXPORT_MULTIPLE("ls", "Logical switch L%d", MAX_LOGICAL_SWITCHES
)
749 MIXSRC_LAST_LOGICAL_SWITCH
= MIXSRC_FIRST_LOGICAL_SWITCH
+MAX_LOGICAL_SWITCHES
-1,
751 MIXSRC_FIRST_TRAINER
, LUA_EXPORT_MULTIPLE("trn", "Trainer input %d", MAX_TRAINER_CHANNELS
)
752 MIXSRC_LAST_TRAINER
= MIXSRC_FIRST_TRAINER
+MAX_TRAINER_CHANNELS
-1,
755 MIXSRC_CH1
= MIXSRC_FIRST_CH
, LUA_EXPORT_MULTIPLE("ch", "Channel CH%d", MAX_OUTPUT_CHANNELS
)
771 MIXSRC_LAST_CH
= MIXSRC_CH1
+MAX_OUTPUT_CHANNELS
-1,
774 MIXSRC_GVAR1
= MIXSRC_FIRST_GVAR
, LUA_EXPORT_MULTIPLE("gvar", "Global variable %d", MAX_GVARS
)
775 MIXSRC_LAST_GVAR
= MIXSRC_FIRST_GVAR
+MAX_GVARS
-1,
777 MIXSRC_TX_VOLTAGE
, LUA_EXPORT("tx-voltage", "Transmitter battery voltage [volts]")
778 MIXSRC_TX_TIME
, LUA_EXPORT("clock", "RTC clock [minutes from midnight]")
779 #if defined(INTERNAL_GPS)
781 MIXSRC_FIRST_RESERVE
,
783 MIXSRC_FIRST_RESERVE
,
790 MIXSRC_TIMER1
= MIXSRC_FIRST_TIMER
, LUA_EXPORT("timer1", "Timer 1 value [seconds]")
791 MIXSRC_TIMER2
, LUA_EXPORT("timer2", "Timer 2 value [seconds]")
792 MIXSRC_TIMER3
, LUA_EXPORT("timer3", "Timer 3 value [seconds]")
793 MIXSRC_LAST_TIMER
= MIXSRC_TIMER3
,
795 MIXSRC_FIRST_TELEM
, LUA_EXPORT_MULTIPLE("telem", "Telemetry sensor %d", MAX_TELEMETRY_SENSORS
)
796 MIXSRC_LAST_TELEM
= MIXSRC_FIRST_TELEM
+3*MAX_TELEMETRY_SENSORS
-1
799 #if defined(__cplusplus)
800 static_assert(MIXSRC_FIRST_LOGICAL_SWITCH
== MIXSRC_FIRST_SWITCH
+ STORAGE_NUM_SWITCHES
, "Wrong switches definition in MIXSRC list");
803 #define MIXSRC_FIRST (MIXSRC_NONE + 1)
804 #define MIXSRC_LAST MIXSRC_LAST_CH
805 #define MIXSRC_LAST_SWITCH (MIXSRC_FIRST_SWITCH + STORAGE_NUM_SWITCHES - 1)
806 #define INPUTSRC_FIRST MIXSRC_Rud
807 #define INPUTSRC_LAST MIXSRC_LAST_TELEM
810 e_backlight_mode_off
= 0,
811 e_backlight_mode_keys
= 1,
812 e_backlight_mode_sticks
= 2,
813 e_backlight_mode_all
= e_backlight_mode_keys
+e_backlight_mode_sticks
,
818 // first the functions which need a checkbox
819 FUNC_OVERRIDE_CHANNEL
,
829 // then the other functions
830 FUNC_FIRST_WITHOUT_ENABLE
,
831 FUNC_PLAY_SOUND
= FUNC_FIRST_WITHOUT_ENABLE
,
838 FUNC_BACKGND_MUSIC_PAUSE
,
845 FUNC_TEST
, // should remain the last before MAX as not added in Companion
859 enum CountDownModes
{
869 enum ResetFunctionParam
{
874 FUNC_RESET_TELEMETRY
,
875 FUNC_RESET_PARAM_FIRST_TELEM
,
876 FUNC_RESET_PARAM_LAST_TELEM
= FUNC_RESET_PARAM_FIRST_TELEM
+ MAX_TELEMETRY_SENSORS
,
877 FUNC_RESET_PARAMS_COUNT
,
878 FUNC_RESET_PARAM_LAST
= FUNC_RESET_PARAMS_COUNT
-1,
881 enum AdjustGvarFunctionParam
{
882 FUNC_ADJUST_GVAR_CONSTANT
,
883 FUNC_ADJUST_GVAR_SOURCE
,
884 FUNC_ADJUST_GVAR_GVAR
,
885 FUNC_ADJUST_GVAR_INCDEC
,
888 enum BluetoothModes
{
895 #define PXX2_LEN_REGISTRATION_ID 8
896 #define PXX2_LEN_RX_NAME 8
897 #define PXX2_MAX_RECEIVERS_PER_MODULE 3
899 #endif // _DATACONSTANTS_H_