[all] PlaySound has now a repeat argument as PlayTrack
[stock] Flash saving in AUDIO code. Warning, I had to change some VOICE prompt numbers, check the tts.py to know which ones! [Taranis] DSM2 protocol added when compiling with DSM2=PPM
This commit is contained in:
@@ -638,6 +638,10 @@ ifeq ($(PCB), TARANIS)
|
||||
SRC += targets/sky9x/syscalls.c
|
||||
endif
|
||||
|
||||
ifeq ($(DSM2), PPM)
|
||||
CPPSRC += protocols/dsm2_arm.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(HUBSAN), YES)
|
||||
CPPDEFS += -DHUBSAN
|
||||
CPPSRC += protocols/hubsan.cpp
|
||||
|
||||
+8
-8
@@ -54,16 +54,17 @@ uint16_t Sine_values[] =
|
||||
|
||||
#if defined(SDCARD)
|
||||
const char * audioFilenames[] = {
|
||||
"inactiv",
|
||||
"lowbatt",
|
||||
#if defined(PCBSKY9X)
|
||||
"highmah",
|
||||
"hightemp",
|
||||
#endif
|
||||
"tada",
|
||||
"thralert",
|
||||
"swalert",
|
||||
"eebad",
|
||||
"eeformat",
|
||||
"lowbatt",
|
||||
"inactiv",
|
||||
#if defined(PCBSKY9X)
|
||||
"highmah",
|
||||
"hightemp",
|
||||
#endif
|
||||
"error",
|
||||
"keyup",
|
||||
"keydown",
|
||||
@@ -74,7 +75,6 @@ const char * audioFilenames[] = {
|
||||
"warning3",
|
||||
"midtrim",
|
||||
"endtrim",
|
||||
"tada",
|
||||
"midpot",
|
||||
"mixwarn1",
|
||||
"mixwarn2",
|
||||
@@ -723,7 +723,7 @@ void audioEvent(uint8_t e, uint8_t f)
|
||||
haptic.event(e); //do this before audio to help sync timings
|
||||
#endif
|
||||
|
||||
if (e <= AU_ERROR || e >= AU_WARNING1) {
|
||||
if (e <= AU_ERROR || (e >= AU_WARNING1 && e < AU_FRSKY_FIRST)) {
|
||||
if (g_eeGeneral.alarmsFlash) {
|
||||
flashCounter = FLASH_DURATION;
|
||||
}
|
||||
|
||||
+38
-100
@@ -167,7 +167,7 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
haptic.event(e); //do this before audio to help sync timings
|
||||
#endif
|
||||
|
||||
if (e <= AU_ERROR || e >= AU_WARNING1) {
|
||||
if (e <= AU_ERROR || (e >= AU_WARNING1 && e < AU_FRSKY_FIRST)) {
|
||||
if (g_eeGeneral.alarmsFlash) {
|
||||
flashCounter = FLASH_DURATION;
|
||||
}
|
||||
@@ -177,105 +177,18 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
if (e < AU_FRSKY_FIRST || empty()) {
|
||||
// TODO when VOICE enable some cases here are not needed!
|
||||
switch (e) {
|
||||
// inactivity timer alert
|
||||
case AU_INACTIVITY:
|
||||
play(70, 10, 2, PLAY_REPEAT(2)|PLAY_NOW);
|
||||
break;
|
||||
// low battery in tx
|
||||
case AU_TX_BATTERY_LOW:
|
||||
if (empty()) {
|
||||
play(60, 20, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
|
||||
play(80, 20, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(-1));
|
||||
}
|
||||
break;
|
||||
// error
|
||||
case AU_ERROR:
|
||||
play(BEEP_DEFAULT_FREQ, 40, 1, PLAY_NOW);
|
||||
break;
|
||||
// keypad up (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
||||
case AU_KEYPAD_UP:
|
||||
play(BEEP_KEY_UP_FREQ, 10, 1, PLAY_NOW);
|
||||
break;
|
||||
// keypad down (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
||||
case AU_KEYPAD_DOWN:
|
||||
play(BEEP_KEY_DOWN_FREQ, 10, 1, PLAY_NOW);
|
||||
break;
|
||||
// menu display (also used by a few generic beeps)
|
||||
case AU_MENUS:
|
||||
play(BEEP_DEFAULT_FREQ, 10, 2, PLAY_NOW);
|
||||
break;
|
||||
// trim move
|
||||
case AU_TRIM_MOVE:
|
||||
play(f, 6, 1, PLAY_NOW);
|
||||
break;
|
||||
// trim center
|
||||
case AU_TRIM_MIDDLE:
|
||||
play(f, 10, 2, PLAY_NOW);
|
||||
break;
|
||||
// warning one
|
||||
case AU_WARNING1:
|
||||
play(BEEP_DEFAULT_FREQ, 10, 1, PLAY_NOW);
|
||||
break;
|
||||
// warning two
|
||||
case AU_WARNING2:
|
||||
play(BEEP_DEFAULT_FREQ, 20, 1, PLAY_NOW);
|
||||
break;
|
||||
// warning three
|
||||
case AU_WARNING3:
|
||||
play(BEEP_DEFAULT_FREQ, 30, 1, PLAY_NOW);
|
||||
break;
|
||||
// pot/stick center
|
||||
case AU_POT_STICK_MIDDLE:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 10, 1, PLAY_NOW);
|
||||
break;
|
||||
// mix warning 1
|
||||
case AU_MIX_WARNING_1:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 6, 0);
|
||||
break;
|
||||
// mix warning 2
|
||||
case AU_MIX_WARNING_2:
|
||||
play(BEEP_DEFAULT_FREQ + 52, 6, 3, PLAY_REPEAT(1));
|
||||
break;
|
||||
// mix warning 3
|
||||
case AU_MIX_WARNING_3:
|
||||
play(BEEP_DEFAULT_FREQ + 54, 6, 3, PLAY_REPEAT(2));
|
||||
break;
|
||||
// time 30 seconds left
|
||||
case AU_TIMER_30:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(2)|PLAY_NOW);
|
||||
break;
|
||||
// time 20 seconds left
|
||||
case AU_TIMER_20:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(1)|PLAY_NOW);
|
||||
break;
|
||||
// time <= 10 seconds left
|
||||
case AU_TIMER_LT10:
|
||||
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_NOW);
|
||||
break;
|
||||
case AU_FRSKY_BEEP1:
|
||||
play(BEEP_DEFAULT_FREQ, 10, 1);
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_BEEP2:
|
||||
play(BEEP_DEFAULT_FREQ, 20, 1);
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_BEEP3:
|
||||
play(BEEP_DEFAULT_FREQ, 30, 1);
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_WARN1:
|
||||
play(BEEP_DEFAULT_FREQ+20, 15, 5, PLAY_REPEAT(2));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_WARN2:
|
||||
play(BEEP_DEFAULT_FREQ+30, 15, 5, PLAY_REPEAT(2));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_CHEEP:
|
||||
play(BEEP_DEFAULT_FREQ+30, 10, 2, PLAY_REPEAT(2)|PLAY_INCREMENT(2));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_RING:
|
||||
play(BEEP_DEFAULT_FREQ+25, 5, 2, PLAY_REPEAT(10));
|
||||
play(BEEP_DEFAULT_FREQ+25, 5, 10, PLAY_REPEAT(1));
|
||||
@@ -311,10 +224,6 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
play(80, 5, 10, PLAY_REPEAT(3));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_SIREN:
|
||||
play(10, 20, 5, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_ALARMC:
|
||||
play(50, 4, 10, PLAY_REPEAT(2));
|
||||
play(70, 8, 20, PLAY_REPEAT(1));
|
||||
@@ -322,16 +231,45 @@ void audioQueue::event(uint8_t e, uint8_t f)
|
||||
play(70, 4, 20, PLAY_REPEAT(1));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_RATATA:
|
||||
play(BEEP_DEFAULT_FREQ+50, 5, 10, PLAY_REPEAT(10));
|
||||
pause(200);
|
||||
break;
|
||||
case AU_FRSKY_TICK:
|
||||
play(BEEP_DEFAULT_FREQ+50, 5, 50, PLAY_REPEAT(2));
|
||||
pause(200);
|
||||
break;
|
||||
default:
|
||||
{
|
||||
const static pm_uint8_t singleSounds[] PROGMEM = {
|
||||
70, 10, 2, PLAY_REPEAT(2)|PLAY_NOW, // INACTIVITY
|
||||
BEEP_DEFAULT_FREQ, 40, 1, PLAY_NOW, // ERROR
|
||||
BEEP_KEY_UP_FREQ, 10, 1, PLAY_NOW, // KEYPAD_UP
|
||||
BEEP_KEY_DOWN_FREQ, 10, 1, PLAY_NOW, // KEYPAD_DOWN
|
||||
BEEP_DEFAULT_FREQ, 10, 2, PLAY_NOW, // MENUS
|
||||
0,0,0,0, // TRIM_MOVE
|
||||
BEEP_DEFAULT_FREQ, 10, 1, PLAY_NOW, // WARNING1
|
||||
BEEP_DEFAULT_FREQ, 20, 1, PLAY_NOW, // WARNING2
|
||||
BEEP_DEFAULT_FREQ, 30, 1, PLAY_NOW, // WARNING3
|
||||
0,0,0,0, // TRIM_MIDDLE
|
||||
BEEP_DEFAULT_FREQ + 50, 10, 1, PLAY_NOW, // POT_STICK_MIDDLE
|
||||
BEEP_DEFAULT_FREQ + 50, 6, 0, // MIX_WARNING_1
|
||||
BEEP_DEFAULT_FREQ + 52, 6, 3, PLAY_REPEAT(1), // MIX_WARNING_2
|
||||
BEEP_DEFAULT_FREQ + 54, 6, 3, PLAY_REPEAT(2), // MIX_WARNING_3
|
||||
BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_NOW, // TIMER_LT10
|
||||
BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(1)|PLAY_NOW, // TIMER_20
|
||||
BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(2)|PLAY_NOW, // TIMER_30
|
||||
BEEP_DEFAULT_FREQ, 10, 1, // FRSKY_BEEP1
|
||||
BEEP_DEFAULT_FREQ, 20, 1, // FRSKY_BEEP2
|
||||
BEEP_DEFAULT_FREQ, 30, 1, // FRSKY_BEEP3
|
||||
BEEP_DEFAULT_FREQ+20, 15, 5, PLAY_REPEAT(2), // FRSKY_WARN1
|
||||
BEEP_DEFAULT_FREQ+30, 15, 5, PLAY_REPEAT(2), // FRSKY_WARN2
|
||||
BEEP_DEFAULT_FREQ+30, 10, 2, PLAY_REPEAT(2)|PLAY_INCREMENT(2), // FRSKY_CHEEP
|
||||
BEEP_DEFAULT_FREQ+50, 5, 10, PLAY_REPEAT(10), // FRSKY_RATATA
|
||||
BEEP_DEFAULT_FREQ+50, 5, 50, PLAY_REPEAT(2), // FRSKY_TICK
|
||||
10, 20, 5, PLAY_REPEAT(2)|PLAY_INCREMENT(1), // FRSKY_SIREN
|
||||
};
|
||||
|
||||
const pm_uint8_t *ptr = &singleSounds[(e-AU_INACTIVITY)<<2];
|
||||
uint8_t tFreq = pgm_read_byte(ptr++);
|
||||
uint8_t tLen = pgm_read_byte(ptr++);
|
||||
uint8_t tPause = pgm_read_byte(ptr++);
|
||||
uint8_t tFlags = pgm_read_byte(ptr);
|
||||
play(tFreq, tLen, tPause, tFlags);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+36
-29
@@ -921,14 +921,14 @@ void menuModelSetup(uint8_t event)
|
||||
#define IF_PORT_ON(idx, x) (idx==0 ? IS_PORT1_ON(x) : (idx==1 ? IS_PORT2_ON(x) : IS_TRAINER_ON()))
|
||||
#define IF_PORT2_XJT(x) (IS_MODULE_XJT(1) ? (uint8_t)x : HIDDEN_ROW)
|
||||
#define PORT1_CHANNELS_ROWS() IF_PORT1_ON(1)
|
||||
#define PORT2_CHANNELS_ROWS() IF_PORT2_ON(g_model.externalModule == MODULE_TYPE_DJT ? (uint8_t)0 : (g_model.externalModule == MODULE_TYPE_DSM2 ? (uint8_t)0 : ((uint8_t)1)))
|
||||
#define PORT2_CHANNELS_ROWS() IF_PORT2_ON(g_model.externalModule == MODULE_TYPE_DJT ? (uint8_t)0 : (IS_MODULE_DSM2(1) ? (uint8_t)0 : ((uint8_t)1)))
|
||||
#define TRAINER_CHANNELS_ROWS() IF_TRAINER_ON(1)
|
||||
#define PORT_CHANNELS_ROWS(x) (x==0 ? PORT1_CHANNELS_ROWS() : (x==1 ? PORT2_CHANNELS_ROWS() : TRAINER_CHANNELS_ROWS()))
|
||||
#define FAILSAFE_ROWS(x) ((g_model.moduleData[x].rfProtocol==RF_PROTO_X16 || g_model.moduleData[x].rfProtocol==RF_PROTO_LR12) ? (g_model.moduleData[x].failsafeMode==FAILSAFE_CUSTOM ? (uint8_t)1 : (uint8_t)0) : HIDDEN_ROW)
|
||||
#define MODEL_SETUP_MAX_LINES (1+ITEM_MODEL_SETUP_MAX)
|
||||
|
||||
bool CURSOR_ON_CELL = (m_posHorz >= 0);
|
||||
MENU_TAB({ 0, 0, CASE_PCBTARANIS(0) 2, IF_PERSISTENT_TIMERS(0) 0, 0, 2, IF_PERSISTENT_TIMERS(0) 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, NAVIGATION_LINE_BY_LINE|(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1), LABEL(InternalModule), 0, IF_PORT1_ON(1), IF_PORT1_ON(2), IF_PORT1_ON(FAILSAFE_ROWS(0)), LABEL(ExternalModule), g_model.externalModule==MODULE_TYPE_XJT ? (uint8_t)1 : (uint8_t)0, PORT2_CHANNELS_ROWS(), (IS_MODULE_PPM(1) || IS_MODULE_XJT(1) ? (uint8_t)2 : HIDDEN_ROW), IF_PORT2_XJT(FAILSAFE_ROWS(1)), LABEL(Trainer), 0, TRAINER_CHANNELS_ROWS(), IF_TRAINER_ON(2)});
|
||||
MENU_TAB({ 0, 0, CASE_PCBTARANIS(0) 2, IF_PERSISTENT_TIMERS(0) 0, 0, 2, IF_PERSISTENT_TIMERS(0) 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, NAVIGATION_LINE_BY_LINE|(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1), LABEL(InternalModule), 0, IF_PORT1_ON(1), IF_PORT1_ON(2), IF_PORT1_ON(FAILSAFE_ROWS(0)), LABEL(ExternalModule), (g_model.externalModule==MODULE_TYPE_XJT || IS_MODULE_DSM2(EXTERNAL_MODULE)) ? (uint8_t)1 : (uint8_t)0, PORT2_CHANNELS_ROWS(), (IS_MODULE_PPM(1) || IS_MODULE_XJT(1)) ? (uint8_t)2 : (IS_MODULE_DSM2(1) ? (uint8_t)1 : HIDDEN_ROW), IF_PORT2_XJT(FAILSAFE_ROWS(1)), LABEL(Trainer), 0, TRAINER_CHANNELS_ROWS(), IF_TRAINER_ON(2)});
|
||||
#elif defined(CPUM64)
|
||||
#define CURSOR_ON_CELL (true)
|
||||
#define MODEL_SETUP_MAX_LINES ((IS_PPM_PROTOCOL(protocol)||IS_DSM2_PROTOCOL(protocol)||IS_PXX_PROTOCOL(protocol)) ? 1+ITEM_MODEL_SETUP_MAX : ITEM_MODEL_SETUP_MAX)
|
||||
@@ -945,7 +945,7 @@ void menuModelSetup(uint8_t event)
|
||||
|
||||
if (!MENU_CHECK(menuTabModel, e_ModelSetup, MODEL_SETUP_MAX_LINES)) {
|
||||
#if defined(DSM2)
|
||||
s_rangecheck_mode = 0;
|
||||
s_rangecheck_mode = false;
|
||||
#endif
|
||||
#if defined(PCBTARANIS)
|
||||
pxxFlag[INTERNAL_MODULE] = 0;
|
||||
@@ -1195,24 +1195,29 @@ void menuModelSetup(uint8_t event)
|
||||
lcd_putsLeft(y, STR_MODULE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""PPM\0""XJT\0""DJT\0""DSM2"), g_model.externalModule, m_posHorz==0 ? attr : 0);
|
||||
if (g_model.externalModule == MODULE_TYPE_XJT)
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, PSTR("\004""OFF\0""X16\0""D8\0 ""LR12"), 1+g_model.moduleData[1].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, PSTR("\004""OFF\0""X16\0""D8\0 ""LR12"), 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
else if (IS_MODULE_DSM2(EXTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, PSTR("\004""LP45""DSM2""DSMX"), g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
if (attr && (editMode>0 || p1valdiff)) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.externalModule, MODULE_TYPE_NONE, MODULE_TYPE_LAST);
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.externalModule, MODULE_TYPE_NONE, MODULE_TYPE_COUNT-1);
|
||||
if (checkIncDec_Ret) {
|
||||
g_model.moduleData[1].channelsStart = 0;
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
|
||||
if (g_model.externalModule == MODULE_TYPE_PPM)
|
||||
g_model.moduleData[1].channelsCount = 0;
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0;
|
||||
else
|
||||
g_model.moduleData[1].channelsCount = MAX_PORT2_CHANNELS();
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsCount = MAX_PORT2_CHANNELS();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST);
|
||||
if (IS_MODULE_DSM2(EXTERNAL_MODULE))
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, DSM2_PROTO_LP45, DSM2_PROTO_DSMX);
|
||||
else
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, RF_PROTO_X16, RF_PROTO_LAST);
|
||||
if (checkIncDec_Ret) {
|
||||
g_model.moduleData[1].channelsStart = 0;
|
||||
g_model.moduleData[1].channelsCount = MAX_PORT2_CHANNELS();
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsCount = MAX_PORT2_CHANNELS();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1277,7 +1282,7 @@ void menuModelSetup(uint8_t event)
|
||||
}
|
||||
else {
|
||||
lcd_putsLeft(y, STR_RXNUM);
|
||||
if (IS_MODULE_XJT(moduleIdx)) {
|
||||
if (IS_MODULE_XJT(moduleIdx) || IS_MODULE_DSM2(moduleIdx)) {
|
||||
lcd_outdezNAtt(MODEL_SETUP_2ND_COLUMN, y, g_model.header.modelId, (m_posHorz==0 ? attr : 0) | LEADING0|LEFT, 2);
|
||||
if (attr && m_posHorz==0) {
|
||||
if (editMode>0 || p1valdiff) {
|
||||
@@ -1288,10 +1293,9 @@ void menuModelSetup(uint8_t event)
|
||||
if (editMode==0 && event==EVT_KEY_BREAK(KEY_ENTER))
|
||||
checkModelIdUnique(g_eeGeneral.currModel);
|
||||
}
|
||||
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MODULE_BIND, m_posHorz==1 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+10*FW, y, STR_MODULE_RANGE, m_posHorz==2 ? attr : 0);
|
||||
{
|
||||
if (IS_MODULE_XJT(moduleIdx)) {
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MODULE_BIND, m_posHorz==1 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+10*FW, y, STR_MODULE_RANGE, m_posHorz==2 ? attr : 0);
|
||||
uint8_t newFlag = 0;
|
||||
if (attr && m_posHorz>0 && s_editMode>0) {
|
||||
if (m_posHorz == 1)
|
||||
@@ -1302,6 +1306,14 @@ void menuModelSetup(uint8_t event)
|
||||
}
|
||||
pxxFlag[moduleIdx] = newFlag;
|
||||
}
|
||||
#if defined(DSM2)
|
||||
else {
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MODULE_RANGE, m_posHorz==1 ? attr : 0);
|
||||
if (attr && m_posHorz>0 && s_editMode>0) {
|
||||
s_rangecheck_mode = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1504,7 +1516,7 @@ void menuModelSetup(uint8_t event)
|
||||
}
|
||||
|
||||
lcd_putsLeft(y, STR_RXNUM);
|
||||
lcd_outdezNAtt(MODEL_SETUP_2ND_COLUMN-3*FW, y, g_model.header.modelId, (m_posHorz<=0 ? attr : 0) | LEADING0|LEFT, 2);
|
||||
lcd_outdezNAtt(MODEL_SETUP_2ND_COLUMN, y, g_model.header.modelId, (m_posHorz<=0 ? attr : 0) | LEADING0|LEFT, 2);
|
||||
if (attr && (m_posHorz==0 && (editMode>0 || p1valdiff))) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.header.modelId, 99);
|
||||
#if defined(CPUARM)
|
||||
@@ -1520,21 +1532,18 @@ void menuModelSetup(uint8_t event)
|
||||
checkModelIdUnique(g_eeGeneral.currModel);
|
||||
#endif
|
||||
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN, y, STR_SYNCMENU, (m_posHorz!=0 ? attr : 0));
|
||||
if (attr && m_posHorz==1) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
// send reset code
|
||||
pxxFlag[0] = PXX_SEND_RXNUM;
|
||||
}
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_SYNCMENU, m_posHorz!=0 ? attr : 0);
|
||||
if (attr && m_posHorz>0 && editMode>0) {
|
||||
// send reset code
|
||||
pxxFlag[0] = PXX_SEND_RXNUM;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DSM2)
|
||||
if (IS_DSM2_PROTOCOL(protocol)) {
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\013Range"TR_ENTER"Norm "TR_ENTER), s_rangecheck_mode, (m_posHorz==1 ? attr : 0));
|
||||
s_rangecheck_mode = (attr && m_posHorz==1 && editMode>0); // [MENU] key toggles range check mode
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_MODULE_RANGE, m_posHorz!=0 ? attr : 0);
|
||||
s_rangecheck_mode = (attr && m_posHorz>0 && editMode>0); // [MENU] key toggles range check mode
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -4391,8 +4400,7 @@ void menuModelCustomFunctions(uint8_t event)
|
||||
menu_lcd_onoff(MODEL_CUSTOM_FUNC_4TH_COLUMN, y, CFN_ACTIVE(sd), attr);
|
||||
if (active) CHECK_INCDEC_MODELVAR_ZERO(event, CFN_ACTIVE(sd), 1);
|
||||
}
|
||||
#if defined(VOICE)
|
||||
else if (sd->swtch && CFN_FUNC(sd) >= FUNC_PLAY_TRACK && CFN_FUNC(sd) <= FUNC_PLAY_VALUE) {
|
||||
else if (sd->swtch && HAS_REPEAT_PARAM()) {
|
||||
#if defined(CPUARM)
|
||||
if (CFN_PLAY_REPEAT(sd))
|
||||
lcd_outdezAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+2+FW, y, CFN_PLAY_REPEAT(sd)*5, attr);
|
||||
@@ -4407,7 +4415,6 @@ void menuModelCustomFunctions(uint8_t event)
|
||||
if (active) CHECK_INCDEC_MODELVAR_ZERO(event, CFN_PLAY_REPEAT(sd), 6);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
else if (attr) {
|
||||
REPEAT_LAST_CURSOR_MOVE();
|
||||
}
|
||||
|
||||
+15
-1
@@ -625,6 +625,12 @@ enum Functions {
|
||||
FUNC_MAX
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
#define HAS_REPEAT_PARAM() (CFN_FUNC(sd) == FUNC_PLAY_SOUND || (CFN_FUNC(sd) >= FUNC_PLAY_TRACK && CFN_FUNC(sd) <= FUNC_PLAY_VALUE))
|
||||
#else
|
||||
#define HAS_REPEAT_PARAM() (CFN_FUNC(sd) == FUNC_PLAY_SOUND)
|
||||
#endif
|
||||
|
||||
enum ResetFunctionParam {
|
||||
FUNC_RESET_TIMER1,
|
||||
FUNC_RESET_TIMER2,
|
||||
@@ -1227,13 +1233,21 @@ enum RFProtocols {
|
||||
RF_PROTO_LAST = RF_PROTO_LR12
|
||||
};
|
||||
|
||||
enum DSM2Protocols {
|
||||
DSM2_PROTO_LP45,
|
||||
DSM2_PROTO_DSM2,
|
||||
DSM2_PROTO_DSMX,
|
||||
};
|
||||
|
||||
enum ModuleTypes {
|
||||
MODULE_TYPE_NONE = 0,
|
||||
MODULE_TYPE_PPM,
|
||||
MODULE_TYPE_XJT,
|
||||
MODULE_TYPE_DJT,
|
||||
#if defined(DSM2)
|
||||
MODULE_TYPE_DSM2,
|
||||
MODULE_TYPE_LAST = MODULE_TYPE_DJT
|
||||
#endif
|
||||
MODULE_TYPE_COUNT
|
||||
};
|
||||
|
||||
enum FailsafeModes {
|
||||
|
||||
+24
-13
@@ -2566,12 +2566,6 @@ void evalFunctions()
|
||||
active = false;
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
if (CFN_FUNC(sd) == FUNC_LOGS) {
|
||||
logDelay = CFN_PARAM(sd);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (CFN_FUNC(sd) == FUNC_RESET) {
|
||||
switch (CFN_PARAM(sd)) {
|
||||
case FUNC_RESET_TIMER1:
|
||||
@@ -2597,24 +2591,29 @@ void evalFunctions()
|
||||
}
|
||||
}
|
||||
|
||||
if (CFN_FUNC(sd) == FUNC_PLAY_SOUND) {
|
||||
AUDIO_PLAY(AU_FRSKY_FIRST+CFN_PARAM(sd));
|
||||
#if defined(SDCARD)
|
||||
else if (CFN_FUNC(sd) == FUNC_LOGS) {
|
||||
logDelay = CFN_PARAM(sd);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
if (CFN_FUNC(sd) == FUNC_HAPTIC) {
|
||||
else if (CFN_FUNC(sd) == FUNC_HAPTIC) {
|
||||
haptic.event(AU_FRSKY_LAST+CFN_PARAM(sd));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM) && defined(SDCARD)
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_SOUND || CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
uint8_t repeatParam = CFN_PLAY_REPEAT(sd);
|
||||
if (!lastFunctionTime[i] || (repeatParam && (signed)(tmr10ms-lastFunctionTime[i])>=500*repeatParam)) {
|
||||
if (!IS_PLAYING(i+1)) {
|
||||
lastFunctionTime[i] = tmr10ms;
|
||||
if (CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
if (CFN_FUNC(sd) == FUNC_PLAY_SOUND) {
|
||||
AUDIO_PLAY(AU_FRSKY_FIRST+CFN_PARAM(sd));
|
||||
}
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
PLAY_VALUE(CFN_PARAM(sd), i+1);
|
||||
}
|
||||
else {
|
||||
@@ -2637,13 +2636,16 @@ void evalFunctions()
|
||||
}
|
||||
}
|
||||
#elif defined(VOICE)
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_BOTH || CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_SOUND || CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_BOTH || CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
uint8_t repeatParam = CFN_PLAY_REPEAT(sd);
|
||||
if (!lastFunctionTime[i] || (CFN_FUNC(sd)==FUNC_PLAY_BOTH && active!=(bool)(activeFnSwitches&switch_mask)) || (repeatParam && (signed)(tmr10ms-lastFunctionTime[i])>=1000*repeatParam)) {
|
||||
lastFunctionTime[i] = tmr10ms;
|
||||
uint8_t param = CFN_PARAM(sd);
|
||||
if (CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
if (CFN_FUNC(sd) == FUNC_PLAY_SOUND) {
|
||||
AUDIO_PLAY(AU_FRSKY_FIRST+param);
|
||||
}
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
|
||||
PLAY_VALUE(param, i+1);
|
||||
}
|
||||
else {
|
||||
@@ -2655,6 +2657,15 @@ void evalFunctions()
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
else if (CFN_FUNC(sd) == FUNC_PLAY_SOUND) {
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
uint8_t repeatParam = CFN_PLAY_REPEAT(sd);
|
||||
if (!lastFunctionTime[i] || (repeatParam && (signed)(tmr10ms-lastFunctionTime[i])>=1000*repeatParam)) {
|
||||
lastFunctionTime[i] = tmr10ms;
|
||||
AUDIO_PLAY(AU_FRSKY_FIRST+CFN_PARAM(sd));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
||||
+18
-11
@@ -366,6 +366,7 @@ enum EnumKeys {
|
||||
#define SWSRC_ID0 SWSRC_SA0
|
||||
#define SWSRC_ID1 SWSRC_SA1
|
||||
#define SWSRC_ID2 SWSRC_SA2
|
||||
#define SW_DSM2_BIND SW_SH2
|
||||
#else
|
||||
#define NUM_SWITCHES 7
|
||||
#define IS_3POS(sw) ((sw) == 0)
|
||||
@@ -373,6 +374,7 @@ enum EnumKeys {
|
||||
#define MAX_PSWITCH (SW_TRN-SW_ID0+1) // 9 physical switches
|
||||
#define NUM_POTS 3
|
||||
#define NUM_SW_SRCRAW 1
|
||||
#define SW_DSM2_BIND SW_TRN
|
||||
#endif
|
||||
|
||||
#define MAX_SWITCH (MAX_PSWITCH+NUM_CSW)
|
||||
@@ -492,10 +494,15 @@ enum EnumKeys {
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
static const int8_t maxChannelsModules[] = { 0, 8, 8, 0, 0 };
|
||||
static const int8_t maxChannelsModules[] = { 0, 8, 8, 0, -2 };
|
||||
static const int8_t maxChannelsXJT[] = { 0, 8, 0, 4 };
|
||||
#define IS_MODULE_XJT(idx) ((idx==0 || g_model.externalModule == MODULE_TYPE_XJT) && (g_model.moduleData[idx].rfProtocol != RF_PROTO_OFF))
|
||||
#define IS_MODULE_PPM(idx) (idx==2 || (idx==1 && g_model.externalModule == MODULE_TYPE_PPM))
|
||||
#if defined(DSM2)
|
||||
#define IS_MODULE_DSM2(idx) (idx==1 && g_model.externalModule == MODULE_TYPE_DSM2)
|
||||
#else
|
||||
#define IS_MODULE_DSM2(idx) false
|
||||
#endif
|
||||
#define NUM_CHANNELS(idx) (8+g_model.moduleData[idx].channelsCount)
|
||||
#define MAX_PORT1_CHANNELS() (maxChannelsXJT[1+g_model.moduleData[0].rfProtocol])
|
||||
#define MAX_PORT2_CHANNELS() ((g_model.externalModule == MODULE_TYPE_XJT) ? maxChannelsXJT[1+g_model.moduleData[1].rfProtocol] : maxChannelsModules[g_model.externalModule])
|
||||
@@ -1257,17 +1264,18 @@ inline bool isFunctionActive(uint8_t func)
|
||||
|
||||
/* make sure the defines below always go in numeric order */
|
||||
enum AUDIO_SOUNDS {
|
||||
AU_INACTIVITY,
|
||||
AU_TX_BATTERY_LOW,
|
||||
#if defined(PCBSKY9X)
|
||||
AU_TX_MAH_HIGH,
|
||||
AU_TX_TEMP_HIGH,
|
||||
#endif
|
||||
AU_TADA,
|
||||
#if defined(VOICE)
|
||||
AU_THROTTLE_ALERT,
|
||||
AU_SWITCH_ALERT,
|
||||
AU_BAD_EEPROM,
|
||||
AU_EEPROM_FORMATTING,
|
||||
#endif
|
||||
AU_TX_BATTERY_LOW,
|
||||
AU_INACTIVITY,
|
||||
#if defined(PCBSKY9X)
|
||||
AU_TX_MAH_HIGH,
|
||||
AU_TX_TEMP_HIGH,
|
||||
#endif
|
||||
AU_ERROR,
|
||||
AU_KEYPAD_UP,
|
||||
@@ -1281,7 +1289,6 @@ enum AUDIO_SOUNDS {
|
||||
#if defined(CPUARM)
|
||||
AU_TRIM_END,
|
||||
#endif
|
||||
AU_TADA,
|
||||
AU_POT_STICK_MIDDLE,
|
||||
AU_MIX_WARNING_1,
|
||||
AU_MIX_WARNING_2,
|
||||
@@ -1305,16 +1312,16 @@ enum AUDIO_SOUNDS {
|
||||
AU_FRSKY_WARN1,
|
||||
AU_FRSKY_WARN2,
|
||||
AU_FRSKY_CHEEP,
|
||||
AU_FRSKY_RATATA,
|
||||
AU_FRSKY_TICK,
|
||||
AU_FRSKY_SIREN,
|
||||
AU_FRSKY_RING,
|
||||
AU_FRSKY_SCIFI,
|
||||
AU_FRSKY_ROBOT,
|
||||
AU_FRSKY_CHIRP,
|
||||
AU_FRSKY_TADA,
|
||||
AU_FRSKY_CRICKET,
|
||||
AU_FRSKY_SIREN,
|
||||
AU_FRSKY_ALARMC,
|
||||
AU_FRSKY_RATATA,
|
||||
AU_FRSKY_TICK,
|
||||
AU_FRSKY_LAST,
|
||||
|
||||
AU_NONE=0xff
|
||||
|
||||
+27
-13
@@ -80,11 +80,22 @@ void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1
|
||||
put_serial_bit(1) ; // Stop bit
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
// TODO should be in the driver
|
||||
void putDsm2Flush()
|
||||
{
|
||||
*Pulses2MHzptr++ = 171 ; // Past the 44000 of the ARR
|
||||
*Pulses2MHzptr++ = 234 ; // Past the 44000 of the ARR
|
||||
}
|
||||
#else
|
||||
#define putDsm2Flush(...)
|
||||
#endif
|
||||
|
||||
// This is the data stream to send, prepare after 19.5 mS
|
||||
// Send after 22.5 mS
|
||||
|
||||
//static uint8_t *Dsm2_pulsePtr = pulses2MHz.pbyte ;
|
||||
void setupPulsesDsm2(uint8_t chns)
|
||||
void setupPulsesDSM2(unsigned int port)
|
||||
{
|
||||
static uint8_t dsmDat[2+6*2]={0xFF,0x00, 0x00,0xAA, 0x05,0xFF, 0x09,0xFF, 0x0D,0xFF, 0x13,0x54, 0x14,0xAA};
|
||||
uint8_t counter ;
|
||||
@@ -97,27 +108,28 @@ void setupPulsesDsm2(uint8_t chns)
|
||||
// If more channels needed make sure the pulses union/array is large enough
|
||||
if (dsmDat[0]&BAD_DATA) //first time through, setup header
|
||||
{
|
||||
switch(s_current_protocol[0])
|
||||
switch(s_current_protocol[port])
|
||||
{
|
||||
case PROTO_DSM2_LP45:
|
||||
dsmDat[0]= 0x80;
|
||||
dsmDat[0] = 0x80;
|
||||
break;
|
||||
case PROTO_DSM2_DSM2:
|
||||
dsmDat[0]=0x90;
|
||||
dsmDat[0] = 0x90;
|
||||
break;
|
||||
default:
|
||||
dsmDat[0]=0x98; //dsmx, bind mode
|
||||
dsmDat[0] = 0x98; //dsmx, bind mode
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((dsmDat[0] & BIND_BIT) && (!switchState(SW_TRN))) dsmDat[0] &= ~BIND_BIT; // clear bind bit if trainer not pulled
|
||||
|
||||
// TODO find a way to do that, FUNC SWITCH: if ((!(dsmDat[0] & BIND_BIT)) && getSwitch(MAX_DRSWITCH-1)) dsmDat[0] |= RANGECHECK_BIT; // range check function
|
||||
// else dsmDat[0] &= ~RANGECHECK_BIT;
|
||||
dsmDat[1]=g_eeGeneral.currModel+1; //DSM2 Header second byte for model match
|
||||
for(uint8_t i=0; i<chns; i++)
|
||||
{
|
||||
uint16_t pulse = limit(0, ((channelOutputs[i]*13)>>5)+512,1023);
|
||||
if ((dsmDat[0] & BIND_BIT) && (!switchState(SW_DSM2_BIND)))
|
||||
dsmDat[0] &= ~BIND_BIT; // clear bind bit if trainer not pulled
|
||||
if ((!(dsmDat[0] & BIND_BIT)) && s_rangecheck_mode)
|
||||
dsmDat[0] |= RANGECHECK_BIT; // range check function
|
||||
else
|
||||
dsmDat[0] &= ~RANGECHECK_BIT;
|
||||
dsmDat[1] = g_model.header.modelId; //DSM2 Header second byte for model match
|
||||
for(uint8_t i=0; i<6; i++) {
|
||||
uint16_t pulse = limit(0, ((channelOutputs[g_model.moduleData[port].channelsStart+i]*13)>>5)+512,1023);
|
||||
dsmDat[2+2*i] = (i<<2) | ((pulse>>8)&0x03);
|
||||
dsmDat[3+2*i] = pulse & 0xff;
|
||||
}
|
||||
@@ -130,4 +142,6 @@ void setupPulsesDsm2(uint8_t chns)
|
||||
{
|
||||
put_serial_bit(1) ; // 16 extra stop bits
|
||||
}
|
||||
|
||||
putDsm2Flush();
|
||||
}
|
||||
|
||||
@@ -45,13 +45,13 @@ void setupPulses(unsigned int port)
|
||||
heartbeat |= (HEART_TIMER_PULSES << port);
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
if (port) port = 1; // Ensure is 0 or 1 only
|
||||
uint8_t required_protocol;
|
||||
|
||||
if (port == INTERNAL_MODULE) {
|
||||
required_protocol = g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF ? PROTO_NONE : PROTO_PXX;
|
||||
}
|
||||
else {
|
||||
port = EXTERNAL_MODULE; // ensure it's external module only
|
||||
switch (g_model.externalModule) {
|
||||
case MODULE_TYPE_PPM:
|
||||
required_protocol = PROTO_PPM;
|
||||
@@ -60,6 +60,11 @@ void setupPulses(unsigned int port)
|
||||
case MODULE_TYPE_DJT:
|
||||
required_protocol = PROTO_PXX;
|
||||
break;
|
||||
#if defined(DSM2)
|
||||
case MODULE_TYPE_DSM2:
|
||||
required_protocol = PROTO_DSM2_LP45 + limit((int8_t)DSM2_PROTO_LP45, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, (int8_t)DSM2_PROTO_DSMX);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
required_protocol = PROTO_NONE;
|
||||
break;
|
||||
@@ -124,7 +129,7 @@ void setupPulses(unsigned int port)
|
||||
case PROTO_DSM2_LP45:
|
||||
case PROTO_DSM2_DSM2:
|
||||
case PROTO_DSM2_DSMX:
|
||||
setupPulsesDsm2(6);
|
||||
setupPulsesDSM2(port);
|
||||
break;
|
||||
#endif
|
||||
case PROTO_PPM:
|
||||
|
||||
@@ -48,7 +48,7 @@ extern uint8_t s_pulses_paused;
|
||||
extern uint32_t failsafeCounter[NUM_MODULES];
|
||||
|
||||
void setupPulses(unsigned int port);
|
||||
void setupPulsesDsm2(uint8_t chns);
|
||||
void setupPulsesDSM2(unsigned int port);
|
||||
void setupPulsesPXX(unsigned int port);
|
||||
void setupPulsesPPM(unsigned int port);
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ normal:
|
||||
*/
|
||||
|
||||
// DSM2=SERIAL mode
|
||||
FORCEINLINE void setupPulsesDsm2()
|
||||
FORCEINLINE void setupPulsesDSM2()
|
||||
{
|
||||
uint16_t *ptr = (uint16_t *)pulses2MHz;
|
||||
switch (s_current_protocol[0])
|
||||
@@ -395,7 +395,7 @@ FORCEINLINE void setupPulsesDsm2()
|
||||
break;
|
||||
}
|
||||
if (s_bind_allowed) s_bind_allowed--;
|
||||
if (s_bind_allowed && switchState(SW_TRN))
|
||||
if (s_bind_allowed && switchState(SW_DSM2_BIND))
|
||||
{
|
||||
s_bind_mode = true;
|
||||
*ptr |= BIND_BIT;
|
||||
@@ -502,7 +502,7 @@ void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1
|
||||
}
|
||||
|
||||
// DSM2=PPM mode
|
||||
void setupPulsesDsm2()
|
||||
void setupPulsesDSM2()
|
||||
{
|
||||
static uint8_t dsmDat[2+6*2] = {0xFF,0x00, 0x00,0xAA, 0x05,0xFF, 0x09,0xFF, 0x0D,0xFF, 0x13,0x54, 0x14,0xAA};
|
||||
uint8_t counter;
|
||||
@@ -891,7 +891,7 @@ void setupPulses()
|
||||
#if defined(DSM2_PPM)
|
||||
sei();
|
||||
#endif
|
||||
setupPulsesDsm2(); // Different versions for DSM2=SERIAL vs. DSM2=PPM
|
||||
setupPulsesDSM2(); // Different versions for DSM2=SERIAL vs. DSM2=PPM
|
||||
#if defined(PCBGRUVIN9X) && defined(DSM2_PPM)
|
||||
// Ensure each DSM2=PPM serial packet starts out with the correct bit polarity
|
||||
TCCR1A = (0 << WGM10) | (3<<COM1B1); // Make Waveform Generator 'SET' OCR1B pin on next compare event and ...
|
||||
|
||||
@@ -95,10 +95,14 @@ void putPcmPart(uint8_t value, unsigned int port)
|
||||
*pxxStreamPtr[port]++ = PxxValue[port] ; // Output 0 for this time
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void putPcmFlush(unsigned int port)
|
||||
{
|
||||
*pxxStreamPtr[port]++ = 18010 ; // Past the 18000 of the ARR
|
||||
}
|
||||
#else
|
||||
#define putPcmFlush(...)
|
||||
#endif
|
||||
|
||||
void putPcmBit(uint8_t bit, unsigned int port)
|
||||
{
|
||||
|
||||
@@ -192,7 +192,7 @@ extern "C" void PWM_IRQHandler(void)
|
||||
else {
|
||||
// Kick off serial output here
|
||||
sscptr = SSC;
|
||||
sscptr->SSC_TPR = (uint32_t) Bit_pulses;
|
||||
sscptr->SSC_TPR = CONVERT_PTR(Bit_pulses);
|
||||
sscptr->SSC_TCR = Serial_byte_count;
|
||||
sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers
|
||||
}
|
||||
|
||||
@@ -118,6 +118,8 @@ void init_ppm( uint32_t module_index );
|
||||
void disable_ppm( uint32_t module_index );
|
||||
void init_pxx( uint32_t module_index );
|
||||
void disable_pxx( uint32_t module_index );
|
||||
void init_dsm2( uint32_t module_index );
|
||||
void disable_dsm2( uint32_t module_index );
|
||||
|
||||
// Trainer driver
|
||||
void init_trainer_ppm();
|
||||
|
||||
@@ -42,7 +42,8 @@ void setupPulsesPXX(unsigned int port);
|
||||
|
||||
uint16_t *ppmStreamPtr[NUM_MODULES];
|
||||
extern uint16_t ppmStream[NUM_MODULES+1][20];
|
||||
extern uint16_t pxxStream[NUM_MODULES][400] ;
|
||||
extern uint16_t pxxStream[NUM_MODULES][400];
|
||||
extern uint8_t Bit_pulses[64];
|
||||
|
||||
static void init_pa10_pxx( void ) ;
|
||||
static void disable_pa10_pxx( void ) ;
|
||||
@@ -50,6 +51,10 @@ static void init_pa10_ppm( void ) ;
|
||||
static void disable_pa10_ppm( void ) ;
|
||||
static void init_pa7_pxx( void ) ;
|
||||
static void disable_pa7_pxx( void ) ;
|
||||
#if defined(DSM2)
|
||||
static void init_pa7_dsm2( void ) ;
|
||||
static void disable_pa7_dsm2( void ) ;
|
||||
#endif
|
||||
static void init_pa7_ppm( void ) ;
|
||||
static void disable_pa7_ppm( void ) ;
|
||||
static void init_pa10_none( void ) ;
|
||||
@@ -73,10 +78,26 @@ void disable_pxx(uint32_t port)
|
||||
disable_pa7_pxx() ;
|
||||
}
|
||||
|
||||
#if defined(DSM2)
|
||||
void init_dsm2(uint32_t port)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
init_pa7_dsm2();
|
||||
}
|
||||
}
|
||||
|
||||
void disable_dsm2(uint32_t port)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
disable_pa7_dsm2();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void init_ppm(uint32_t port)
|
||||
{
|
||||
if (port == INTERNAL_MODULE)
|
||||
init_pa10_ppm();
|
||||
init_pa10_ppm(); // TODO needed?
|
||||
else
|
||||
init_pa7_ppm();
|
||||
}
|
||||
@@ -84,7 +105,7 @@ void init_ppm(uint32_t port)
|
||||
void disable_ppm(uint32_t port)
|
||||
{
|
||||
if (port == INTERNAL_MODULE)
|
||||
disable_pa10_ppm();
|
||||
disable_pa10_ppm(); // TODO needed?
|
||||
else
|
||||
disable_pa7_ppm();
|
||||
}
|
||||
@@ -418,6 +439,80 @@ static void disable_pa7_pxx()
|
||||
EXTERNAL_RF_OFF();
|
||||
}
|
||||
|
||||
#if defined(DSM2)
|
||||
static void init_pa7_dsm2()
|
||||
{
|
||||
EXTERNAL_RF_ON();
|
||||
|
||||
// Timer8
|
||||
setupPulsesDSM2(EXTERNAL_MODULE);
|
||||
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN ; // Enable portA clock
|
||||
#if defined(REV3)
|
||||
configure_pins( PIN_INTPPM_OUT, PIN_PERIPHERAL | PIN_PORTA | PIN_PER_1 | PIN_OS25 | PIN_PUSHPULL ) ;
|
||||
#else
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIO_EXTPPM, ENABLE);
|
||||
GPIO_PinAFConfig(GPIO_EXTPPM, GPIO_PinSource_EXTPPM, GPIO_AF_TIM8);
|
||||
GPIO_InitStructure.GPIO_Pin = PIN_EXTPPM_OUT;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(GPIO_EXTPPM, &GPIO_InitStructure);
|
||||
#endif
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM8EN ; // Enable clock
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2EN ; // Enable DMA2 clock
|
||||
|
||||
TIM8->CR1 &= ~TIM_CR1_CEN ;
|
||||
TIM8->ARR = 44000 ; // 22mS
|
||||
TIM8->CCR2 = 30000 ; // Update time
|
||||
TIM8->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
#if defined(REV3)
|
||||
TIM8->CCER = TIM_CCER_CC1E | TIM_CCER_CC1P ;
|
||||
#else
|
||||
TIM8->CCER = TIM_CCER_CC1NE ;
|
||||
#endif
|
||||
TIM8->CR2 = TIM_CR2_OIS1 ; // O/P idle high
|
||||
TIM8->BDTR = TIM_BDTR_MOE ; // Enable outputs
|
||||
TIM8->CCR1 = pxxStream[EXTERNAL_MODULE][0] ;
|
||||
TIM8->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_0 ; // Force O/P high
|
||||
TIM8->EGR = 1 ; // Restart
|
||||
|
||||
// TIM8->SR &= ~TIM_SR_UIF ; // Clear flag
|
||||
// TIM8->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
TIM8->DIER |= TIM_DIER_CC1DE ; // Enable DMA on CC1 match
|
||||
TIM8->DCR = 13 ; // DMA to CC1
|
||||
|
||||
// TIM8->CR1 = TIM_CR1_OPM ; // Just run once
|
||||
// Enable the DMA channel here, DMA2 stream 2, channel 7
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
|
||||
DMA2_Stream2->CR = DMA_SxCR_CHSEL_0 | DMA_SxCR_CHSEL_1 | DMA_SxCR_CHSEL_2 | DMA_SxCR_PL_0 | DMA_SxCR_MSIZE_0
|
||||
| DMA_SxCR_PSIZE_0 | DMA_SxCR_MINC | DMA_SxCR_DIR_0 | DMA_SxCR_PFCTRL ;
|
||||
DMA2_Stream2->PAR = CONVERT_PTR(&TIM8->DMAR);
|
||||
DMA2_Stream2->M0AR = CONVERT_PTR(&pxxStream[EXTERNAL_MODULE][1]);
|
||||
// DMA2_Stream2->FCR = 0x05 ; //DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0 ;
|
||||
// DMA2_Stream2->NDTR = 100 ;
|
||||
DMA2_Stream2->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
|
||||
TIM8->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0 ; // Toggle CC1 o/p
|
||||
TIM8->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
TIM8->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
TIM8->CR1 |= TIM_CR1_CEN ;
|
||||
NVIC_EnableIRQ(TIM8_CC_IRQn) ;
|
||||
}
|
||||
|
||||
static void disable_pa7_dsm2()
|
||||
{
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
NVIC_DisableIRQ(TIM8_CC_IRQn) ;
|
||||
TIM8->DIER &= ~TIM_DIER_CC2IE ;
|
||||
TIM8->CR1 &= ~TIM_CR1_CEN ;
|
||||
EXTERNAL_RF_OFF();
|
||||
}
|
||||
#endif
|
||||
|
||||
// PPM output
|
||||
// Timer 1, channel 1 on PA8 for prototype
|
||||
// Pin is AF1 function for timer 1
|
||||
@@ -484,9 +579,19 @@ extern "C" void TIM8_CC_IRQHandler()
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
|
||||
DMA2_Stream2->M0AR = CONVERT_PTR(&pxxStream[EXTERNAL_MODULE][1]);
|
||||
DMA2_Stream2->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
TIM8->CCR1 = pxxStream[EXTERNAL_MODULE][0] ;
|
||||
TIM8->CCR1 = pxxStream[EXTERNAL_MODULE][0];
|
||||
TIM8->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
}
|
||||
#if defined(DSM2)
|
||||
else if (s_current_protocol[EXTERNAL_MODULE] >= PROTO_DSM2_LP45 && s_current_protocol[EXTERNAL_MODULE] <= PROTO_DSM2_DSMX) {
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
|
||||
DMA2_Stream2->M0AR = CONVERT_PTR(&Bit_pulses[2]);
|
||||
DMA2_Stream2->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
TIM8->CCR1 = ((uint16_t *)Bit_pulses)[0];
|
||||
TIM8->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
}
|
||||
#endif
|
||||
else if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PPM) {
|
||||
ppmStreamPtr[EXTERNAL_MODULE] = ppmStream[EXTERNAL_MODULE];
|
||||
TIM8->DIER |= TIM_DIER_UDE ;
|
||||
|
||||
@@ -447,7 +447,6 @@ const pm_char STR_CHANNELS_MONITOR[] PROGMEM = TR_CHANNELS_MONITOR;
|
||||
#if defined(PCBTARANIS)
|
||||
const pm_char STR_BYTES[] PROGMEM = TR_BYTES;
|
||||
const pm_char STR_MODULE_BIND[] PROGMEM = TR_MODULE_BIND;
|
||||
const pm_char STR_MODULE_RANGE[] PROGMEM = TR_MODULE_RANGE;
|
||||
const pm_char STR_SET[] PROGMEM = TR_SET;
|
||||
const pm_char STR_TRAINER[] PROGMEM = TR_TRAINER;
|
||||
const pm_char STR_ANTENNAPROBLEM[] PROGMEM = TR_ANTENNAPROBLEM;
|
||||
@@ -457,6 +456,10 @@ const pm_char STR_CHANNELS_MONITOR[] PROGMEM = TR_CHANNELS_MONITOR;
|
||||
const pm_char STR_CRITICALALARM[] PROGMEM = TR_CRITICALALARM;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(DSM2)
|
||||
const pm_char STR_MODULE_RANGE[] PROGMEM = TR_MODULE_RANGE;
|
||||
#endif
|
||||
|
||||
#if !defined(CPUM64)
|
||||
const pm_char STR_ABOUTUS[] PROGMEM = TR_ABOUTUS;
|
||||
const pm_char STR_ABOUT_OPENTX_1[] PROGMEM = TR_ABOUT_OPENTX_1;
|
||||
|
||||
+4
-1
@@ -621,7 +621,6 @@ extern const pm_char STR_CHANNELS_MONITOR[];
|
||||
#if defined(PCBTARANIS)
|
||||
extern const pm_char STR_BYTES[];
|
||||
extern const pm_char STR_MODULE_BIND[];
|
||||
extern const pm_char STR_MODULE_RANGE[];
|
||||
extern const pm_char STR_SET[];
|
||||
extern const pm_char STR_TRAINER[];
|
||||
extern const pm_char STR_ANTENNAPROBLEM[];
|
||||
@@ -631,6 +630,10 @@ extern const pm_char STR_CHANNELS_MONITOR[];
|
||||
extern const pm_char STR_CRITICALALARM[];
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(DSM2)
|
||||
extern const pm_char STR_MODULE_RANGE[];
|
||||
#endif
|
||||
|
||||
#if !defined(CPUM64)
|
||||
extern const pm_char STR_ABOUTUS[];
|
||||
extern const pm_char STR_ABOUT_OPENTX_1[];
|
||||
|
||||
@@ -221,8 +221,8 @@
|
||||
|
||||
#define TR_VFSWRESET "Tmr1\0""Tmr2\0""V\207e\0 " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick "
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
|
||||
@@ -221,8 +221,8 @@
|
||||
|
||||
#define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""Alle\0" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1 ""Timer 2 ""Alle Tmr." TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Piep1\0""Piep2\0""Piep3\0""Warn1\0""Warn2\0""Cheep\0""Ring\0 ""SciFi\0""Robot\0""Chirp\0""Tada\0 ""Crickt""Siren\0""AlmClk""Ratata""Tick\0 "
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Piep1\0""Piep2\0""Piep3\0""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
|
||||
@@ -221,8 +221,8 @@
|
||||
|
||||
#define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""All\0 " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1 ""Timer 2 ""All " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick "
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
@@ -531,7 +531,7 @@
|
||||
#define TR_MENUSTAT "STATS"
|
||||
#define TR_MENUDEBUG "DEBUG"
|
||||
#define TR_RXNUM TR("RxNum", INDENT"Receiver No.")
|
||||
#define TR_SYNCMENU "Sync "TR_ENTER
|
||||
#define TR_SYNCMENU "[Sync]"
|
||||
#define TR_LIMIT INDENT"Limit"
|
||||
#define TR_MINRSSI "Min Rssi"
|
||||
#define TR_LATITUDE "Latitude"
|
||||
|
||||
@@ -221,8 +221,8 @@
|
||||
|
||||
#define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""All\0 " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Reloj 1 ""Reloj 2 ""Todo " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Beep1 ""Beep2 ""Beep3 ""Aviso1""Aviso2""Cheep ""Ring ""SciFi ""Robot ""Gorjeo""Tada ""Crickt""Sirena""Alarma""Ratata""Tictac"
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Avs1""Avs2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Aviso1""Aviso2""Cheep ""Ratata""Tick ""Sirena""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
|
||||
@@ -219,12 +219,12 @@
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
|
||||
#define TR_VFSWRESET "Timer1""Timer2""Timers" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
#define TR_VFSWRESET "Timer1""Timer2""Timers" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Beep1\0""Beep2\0""Beep3\0""Warn1\0""Warn2\0""Cheep\0""Ring\0 ""SciFi\0""Robot\0""Chirp\0""Tada\0 ""Crickt""Siren\0""AlmClk""Ratata""Tick\0 "
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_RSSI_0 "SWR\0"
|
||||
#define TR_RSSI_1 "RSSI"
|
||||
@@ -232,7 +232,7 @@
|
||||
#define TR_RSSI_0 "Tx\0 "
|
||||
#define TR_RSSI_1 "Rx\0 "
|
||||
#endif
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Chr1""Chr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vit\0""Dist""AltG""Elem""Velm""Vfas""Cour""Cnsm""Puis""AccX""AccY""AccZ""Cap\0""VitV""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vit+""Dst+""Cur+""Pwr+""Acc\0""Time"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Chr1""Chr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vit\0""Dist""AltG""Elem""Velm""Vfas""Cour""Cnsm""Puis""AccX""AccY""AccZ""Cap\0""VitV""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vit+""Dst+""Cur+""Pwr+""Acc\0""Time"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VUNITSSYSTEM TR("\006", "\012")
|
||||
|
||||
@@ -219,12 +219,12 @@
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
|
||||
#define TR_VFSWRESET "Timer1""Timer2""Tutto " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
#define TR_VFSWRESET "Timer1""Timer2""Tutto " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick "
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_RSSI_0 "SWR\0"
|
||||
#define TR_RSSI_1 "RSSI"
|
||||
@@ -232,7 +232,7 @@
|
||||
#define TR_RSSI_0 "Tx\0 "
|
||||
#define TR_RSSI_1 "Rx\0 "
|
||||
#endif
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vel\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsm""Powr""AccX""AccY""AccZ""Dir\0""VelV""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+""Cur+""Pwr+""Acc\0""Time"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vel\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsm""Powr""AccX""AccY""AccZ""Dir\0""VelV""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+""Cur+""Pwr+""Acc\0""Time"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VUNITSSYSTEM TR("\006", "\011")
|
||||
|
||||
@@ -219,12 +219,12 @@ Padding for row alignment
|
||||
#define TR_FSW_RESET_ROTENC
|
||||
#endif
|
||||
|
||||
#define TR_VFSWRESET "Tempo1""Tempo2""Todo " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
#define TR_VFSWRESET "Tempo1""Tempo2""Todo " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Beep1 ""Beep2 ""Beep3 ""Avis1 ""Avis2 ""Pio ""Ring ""SciFi ""Robot ""Gorjeo""Tada ""Crickt""Sirene""Alarme""Ratata""Tictac"
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Avis1 ""Avis2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
#define TR_RSSI_0 "SWR\0"
|
||||
#define TR_RSSI_1 "RSSI"
|
||||
@@ -232,7 +232,7 @@ Padding for row alignment
|
||||
#define TR_RSSI_0 "Tx\0 "
|
||||
#define TR_RSSI_1 "Rx\0 "
|
||||
#endif
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VVel""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+""Cur+""Pwr+""Acc\0""Hora"
|
||||
#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_RSSI_0 TR_RSSI_1 "A1\0 ""A2\0 ""Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VVel""A1-\0""A2-\0""Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+""Cur+""Pwr+""Acc\0""Hora"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define LEN_VUNITSSYSTEM TR("\006", "\010")
|
||||
|
||||
@@ -221,8 +221,8 @@
|
||||
|
||||
#define TR_VFSWRESET TR("Tmr1\0""Tmr2\0""Allt\0" TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC, "Timer 1 ""Timer 2 ""Allt " TR_FSW_RESET_TELEM TR_FSW_RESET_ROTENC)
|
||||
|
||||
#define LEN_FUNCSOUNDS "\006"
|
||||
#define TR_FUNCSOUNDS "Pip1 ""Pip2 ""Pip3 ""Varn1 ""Varn2 ""F\200r ""Ring ""SciFi ""Robot ""F\200gel ""Tada ""Syrsa ""Siren ""Alarm ""Ratata""Tick "
|
||||
#define LEN_FUNCSOUNDS TR("\004", "\006")
|
||||
#define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk")
|
||||
|
||||
#define LEN_VTELEMCHNS "\004"
|
||||
#if defined(PCBTARANIS)
|
||||
|
||||
+37
-50
@@ -200,17 +200,16 @@ if __name__ == "__main__":
|
||||
"point four", "point five", "point six",
|
||||
"point seven", "point eight", "point nine"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+160+i))
|
||||
for s, f, a in [(u"trim center", "midtrim", 494),
|
||||
for s, f, a in [(u"trim center", "midtrim", 495),
|
||||
(u"maximum trim reached", "endtrim", NO_ALTERNATE),
|
||||
(u"transmitter battery low", "lowbatt", 481),
|
||||
(u"inactivity alarm", "inactiv", 480),
|
||||
(u"throttle warning", "thralert", 482),
|
||||
(u"switch warning", "swalert", 483),
|
||||
(u"Welcome to open nine ex!", "tada", 495),
|
||||
(u"tick. tock", "timerlt3", 500),
|
||||
(u"ten. seconds", "timer10", 501),
|
||||
(u"twenty. seconds", "timer20", 502),
|
||||
(u"thirty. seconds", "timer30", 503),
|
||||
(u"transmitter battery low", "lowbatt", 485),
|
||||
(u"inactivity alarm", "inactiv", 486),
|
||||
(u"throttle warning", "thralert", 481),
|
||||
(u"switch warning", "swalert", 482),
|
||||
(u"bad eeprom", "eebad", 483),
|
||||
(u"Welcome to open nine ex!", "tada", 480),
|
||||
(u"twenty. seconds", "timer20", 500),
|
||||
(u"thirty. seconds", "timer30", 501),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, (s, f) in enumerate([
|
||||
@@ -312,21 +311,18 @@ if __name__ == "__main__":
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+103+i))
|
||||
for i, s in enumerate(["volt", "amper", "meetri per secondo", "", "chilomeetri ora", "meetri", "gradi", "percento", "milliamper", "milliamper ora", "watt", "db", "piedi", "nodi", "ore", "minuti", "secondi", "R P M", "g"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+113+i))
|
||||
for s, f, a in [(u"radio inattiva controllare", "inactiv", 480),
|
||||
(u"batteria della radio scarica", "lowbatt", 481),
|
||||
(u"controllo motore non in posizione, verificare", "thralert", 482),
|
||||
(u"interruttori non in posizione, verificare", "swalert", 483),
|
||||
for s, f, a in [(u"radio inattiva controllare", "inactiv", 486),
|
||||
(u"batteria della radio scarica", "lowbatt", 485),
|
||||
(u"controllo motore non in posizione, verificare", "thralert", 481),
|
||||
(u"interruttori non in posizione, verificare", "swalert", 482),
|
||||
(u"eeprom corrotta", "eebad", NO_ALTERNATE),
|
||||
(u"formattazone eeprom in corso", "eeformat", NO_ALTERNATE),
|
||||
(u"errore", "error", NO_ALTERNATE),
|
||||
(u"trim centrato", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"trim centrato", "midtrim", 495),
|
||||
(u"potenziometro centrato", "midpot", 496),
|
||||
(u"massimo trim raggiunto", "endtrim", NO_ALTERNATE),
|
||||
(u"3 secondi al termine", "timerlt3", 500),
|
||||
(u"dieci secondi", "timer10", 501),
|
||||
(u"venti secondi", "timer20", 502),
|
||||
(u"trenta secondi", "timer30", 503),
|
||||
(u"venti secondi", "timer20", 500),
|
||||
(u"trenta secondi", "timer30", 501),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate(["timer", "timer", "trasmissione", "ricezione", "A1", "A2", "altitudine", "motore",
|
||||
@@ -382,21 +378,18 @@ if __name__ == "__main__":
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+102+i))
|
||||
for i, s in enumerate(["Volt", "Ampere", "Meter pro sekunde", "", "kilometer pro stunde", "Meter", "Grad", "Prozent", "Milliampere", "Milliampere pro stunde", "Watt", "db", "Fuesse", "Knoten", "Uhr", "Minuten", "Secunden", "R P M", "g"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+110+i))
|
||||
for s, f, a in [(u"Sender ist inaktiv,bitte Ueberpruefen Sie", "inactiv", 480),
|
||||
(u"Senderakku niedrig", "lowbatt", 481),
|
||||
(u"Gaskanal nicht Null, bitte pruefen", "thralert", 482),
|
||||
(u"Schalten fehlpositioniert, bitte pruefen", "swalert", 483),
|
||||
for s, f, a in [(u"Sender ist inaktiv,bitte Ueberpruefen Sie", "inactiv", 486),
|
||||
(u"Senderakku niedrig", "lowbatt", 485),
|
||||
(u"Gaskanal nicht Null, bitte pruefen", "thralert", 481),
|
||||
(u"Schalten fehlpositioniert, bitte pruefen", "swalert", 482),
|
||||
(u"Das EEPROM ist fehlerhaft", "eebad", NO_ALTERNATE),
|
||||
(u"Das EEPROM ist immer formatiert", "eeformat", NO_ALTERNATE),
|
||||
(u"fehler", "error", NO_ALTERNATE),
|
||||
(u"Trim zentriert", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"Trim zentriert", "midtrim", 495),
|
||||
(u"Poti zentriert", "midpot", 496),
|
||||
(u"Maximale trimmung erreicht", "endtrim", NO_ALTERNATE),
|
||||
(u"Noch drei sekunden", "timerlt3", 500),
|
||||
(u"10 sekunden", "timer10", 501),
|
||||
(u"20 sekunden", "timer20", 502),
|
||||
(u"30 sekunden", "timer30", 503),
|
||||
(u"20 sekunden", "timer20", 500),
|
||||
(u"30 sekunden", "timer30", 501),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate(["Timer", "Timer", "Sendung", "Empfang", "A1", "A2", "Hoehe", "Motor",
|
||||
@@ -461,21 +454,18 @@ if __name__ == "__main__":
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+111+i))
|
||||
for i, s in enumerate([u"Volt", u"ampére", u"metros por segundo", u"", u"quilômetros por hora", u"metros", u"graus", u"cento", u"miliamperes", u"miliamperes por hora", u"watt", u"db", u"pés", u"nós", u"horas", u"minutos", u"segundos", u"RPM", u"g"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+122+i))
|
||||
for s, f, a in [(u"atenção, o rádio foi esquecido ligado, por favor desligue-o", "inactiv", 480),
|
||||
(u"bateria do rádio fraca", "lowbatt", 481),
|
||||
(u"atenção,acelerador não está no mínimo", "thralert", 482),
|
||||
(u"atenção, certifique-se que os interruptores estão na posição certa", "swalert", 483),
|
||||
for s, f, a in [(u"atenção, o rádio foi esquecido ligado, por favor desligue-o", "inactiv", 486),
|
||||
(u"bateria do rádio fraca", "lowbatt", 485),
|
||||
(u"atenção,acelerador não está no mínimo", "thralert", 481),
|
||||
(u"atenção, certifique-se que os interruptores estão na posição certa", "swalert", 482),
|
||||
(u"eeprom corrompida", "eebad", NO_ALTERNATE),
|
||||
(u"formatação da eeprom em curso", "eeformat", NO_ALTERNATE),
|
||||
(u"erro", "error", NO_ALTERNATE),
|
||||
(u"trim centrado", "midtrim", 494),
|
||||
(u"tada", "tada", 495),
|
||||
(u"trim centrado", "midtrim", 495),
|
||||
(u"potenciómetro centrado", "midpot", 496),
|
||||
(u"trim no máximo", "endtrim", NO_ALTERNATE),
|
||||
(u"3 segundos", "timerlt3", 500),
|
||||
(u"10 segundos", "timer10", 501),
|
||||
(u"20 segundos", "timer20", 502),
|
||||
(u"30 segundos", "timer30", 503),
|
||||
(u"20 segundos", "timer20", 500),
|
||||
(u"30 segundos", "timer30", 501),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, s in enumerate([u"cronómetro", u"cronómetro", u"transmissão", u"recepção", u"A1", u"A2", u"altitude", u"motor",
|
||||
@@ -555,17 +545,14 @@ if __name__ == "__main__":
|
||||
u"gé", u"gé", u"gé", u"gé"]):
|
||||
systemSounds.extend(generate(s, PROMPT_SYSTEM_BASE+118+i))
|
||||
|
||||
for s, f, a in [(u"střed trimu", "midtrim", 494),
|
||||
for s, f, a in [(u"střed trimu", "midtrim", 495),
|
||||
(u"maximum trimu", "endtrim", NO_ALTERNATE),
|
||||
(u"baterie rádia je vybitá", "lowbatt", 481),
|
||||
(u"zapoměl jsi na mě!", "inactiv", 480),
|
||||
(u"plyn není na nule", "thralert", 482),
|
||||
(u"přepínače nejsou ve výchozí poloze", "swalert", 483),
|
||||
(u"tadá", "tada", 495),
|
||||
(u"ťik ťak", "timerlt3", 500),
|
||||
(u"deset sekund", "timer10", 501),
|
||||
(u"dvacet sekund", "timer20", 502),
|
||||
(u"třicet sekund", "timer30", 503),
|
||||
(u"baterie rádia je vybitá", "lowbatt", 485),
|
||||
(u"zapoměl jsi na mě!", "inactiv", 486),
|
||||
(u"plyn není na nule", "thralert", 481),
|
||||
(u"přepínače nejsou ve výchozí poloze", "swalert", 482),
|
||||
(u"dvacet sekund", "timer20", 500),
|
||||
(u"třicet sekund", "timer30", 501),
|
||||
]:
|
||||
systemSounds.extend(generate(s, f, a))
|
||||
for i, (s, f) in enumerate([
|
||||
|
||||
Reference in New Issue
Block a user