Added a SOMO function with track number 0-255

This commit is contained in:
bsongis
2012-02-15 17:45:38 +00:00
parent 0c8cea428d
commit 4bd49938f3
3 changed files with 18 additions and 10 deletions
+11 -9
View File
@@ -1762,22 +1762,24 @@ void menuProcFunctionSwitches(uint8_t event)
break; break;
case 2: case 2:
if (sd->swtch) { if (sd->swtch) {
int16_t val_displayed; int16_t val_displayed = sd->param;
int8_t val_min; int16_t val_min = 0;
int8_t val_max; int16_t val_max = 255;
if (sd->func == FUNC_PLAY_SOUND) { if (sd->func == FUNC_PLAY_SOUND) {
val_displayed = sd->param; #if defined(AUDIO)
#ifdef AUDIO
val_min = 0;
val_max = AU_FRSKY_LAST-AU_FRSKY_FIRST-1; val_max = AU_FRSKY_LAST-AU_FRSKY_FIRST-1;
lcd_putsnAtt(15*FW, y, STR_FUNCSOUNDS+LEN_FUNCSOUNDS*val_displayed, LEN_FUNCSOUNDS, attr); lcd_putsnAtt(15*FW, y, STR_FUNCSOUNDS+LEN_FUNCSOUNDS*val_displayed, LEN_FUNCSOUNDS, attr);
#else #else
break; break;
#endif #endif
} }
#if defined(SOMO)
else if (sd->func == FUNC_PLAY_SOMO) {
lcd_outdezAtt(21*FW, y, val_displayed, attr);
}
#endif
else if (sd->func <= FUNC_SAFETY_CH16) { else if (sd->func <= FUNC_SAFETY_CH16) {
val_displayed = (int8_t)sd->param; val_displayed = (int16_t)(int8_t)sd->param;
val_min = -125; val_min = -125;
val_max = 125; val_max = 125;
lcd_outdezAtt(21*FW, y, val_displayed, attr); lcd_outdezAtt(21*FW, y, val_displayed, attr);
@@ -1787,7 +1789,7 @@ void menuProcFunctionSwitches(uint8_t event)
} }
if (active) { if (active) {
CHECK_INCDEC_MODELVAR(event, sd->param, val_min, val_max); sd->param = checkIncDec(event, val_displayed, val_min, val_max, EE_MODEL);
} }
} }
else if (attr) { else if (attr) {
+1
View File
@@ -176,6 +176,7 @@ enum Functions {
FUNC_INSTANT_TRIM, FUNC_INSTANT_TRIM,
FUNC_TRIMS_2_OFS, FUNC_TRIMS_2_OFS,
FUNC_PLAY_SOUND, FUNC_PLAY_SOUND,
FUNC_PLAY_SOMO,
#ifdef LOGS #ifdef LOGS
FUNC_LOGS, FUNC_LOGS,
#endif #endif
+6 -1
View File
@@ -1084,7 +1084,7 @@ void evalFunctions()
if (sd->func < FUNC_TRAINER) { if (sd->func < FUNC_TRAINER) {
safetyCh[sd->func] = (int8_t)sd->param; safetyCh[sd->func] = (int8_t)sd->param;
} }
if (sd->func == FUNC_PLAY_SOUND/* && (~active_functions & mask)*/) { if (sd->func == FUNC_PLAY_SOUND) {
#if defined(AUDIO) #if defined(AUDIO)
audioDefevent(AU_FRSKY_FIRST+sd->param); audioDefevent(AU_FRSKY_FIRST+sd->param);
#else #else
@@ -1093,6 +1093,11 @@ void evalFunctions()
} }
#endif #endif
} }
#if defined(SOMO)
if (sd->func == FUNC_PLAY_SOMO && (~active_functions & mask)) {
somoPushPrompt(sd->param);
}
#endif
active_functions |= mask; active_functions |= mask;
} }
else { else {