Play Telemetry on ersky9x board
This commit is contained in:
@@ -616,3 +616,15 @@ void audioEvent(uint8_t e, uint8_t f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pushPrompt(uint16_t prompt)
|
||||
{
|
||||
char filename[] = SYSTEM_SOUNDS_PATH "/0000.wav";
|
||||
|
||||
for (int8_t i=3; i>=0; i++) {
|
||||
filename[sizeof(SYSTEM_SOUNDS_PATH)+i] = '0' + (prompt%10);
|
||||
prompt /= 10;
|
||||
}
|
||||
|
||||
audioQueue.playFile(filename);
|
||||
}
|
||||
|
||||
@@ -130,4 +130,6 @@ void audioEvent(uint8_t e, uint8_t f=BEEP_DEFAULT_FREQ);
|
||||
|
||||
#define AUDIO_HEARTBEAT()
|
||||
|
||||
extern void pushPrompt(uint16_t prompt);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2304,6 +2304,10 @@ void menuProcFunctionSwitches(uint8_t event)
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (sd->func == FUNC_PLAY_VALUE) {
|
||||
val_max = NUM_XCHNPLAY;
|
||||
putsChnRaw(17*FW, y, val_displayed+1, attr);
|
||||
}
|
||||
#endif
|
||||
#if defined(PCBARM)
|
||||
else if (sd->func == FUNC_VOLUME) {
|
||||
|
||||
+14
-7
@@ -416,6 +416,7 @@ void applyExpos(int16_t *anas)
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(PCBARM)
|
||||
int16_t calc1000toRESX(int16_t x)
|
||||
{
|
||||
// return x + x/32 - x/128 + x/512;
|
||||
@@ -425,6 +426,7 @@ int16_t calc1000toRESX(int16_t x)
|
||||
x-=y;
|
||||
return x+(y>>2);
|
||||
}
|
||||
#endif
|
||||
|
||||
int16_t applyLimits(uint8_t channel, int32_t value)
|
||||
{
|
||||
@@ -1563,7 +1565,7 @@ void testFunc()
|
||||
uint16_t activeFunctions = 0;
|
||||
MASK_FSW_TYPE active_switches = 0;
|
||||
|
||||
#if defined(SOMO)
|
||||
#if defined(PCBARM) || defined(SOMO)
|
||||
void playValue(uint8_t idx)
|
||||
{
|
||||
int16_t val = getValue(idx);
|
||||
@@ -1716,13 +1718,18 @@ void evalFunctions()
|
||||
#endif
|
||||
|
||||
#if defined(PCBARM) && defined(SDCARD)
|
||||
else if (sd->func == FUNC_PLAY_TRACK) {
|
||||
else if (sd->func == FUNC_PLAY_TRACK || sd->func == FUNC_PLAY_VALUE) {
|
||||
if (!audioQueue.busy()) {
|
||||
char lfn[32] = SOUNDS_PATH "/";
|
||||
strncpy(lfn+sizeof(SOUNDS_PATH), sd->param, sizeof(sd->param));
|
||||
lfn[sizeof(SOUNDS_PATH)+sizeof(sd->param)] = '\0';
|
||||
strcat(lfn+sizeof(SOUNDS_PATH), SOUNDS_EXT);
|
||||
audioQueue.playFile(lfn);
|
||||
if (sd->func == FUNC_PLAY_TRACK) {
|
||||
char lfn[] = SOUNDS_PATH "/xxxxxx.wav";
|
||||
strncpy(lfn+sizeof(SOUNDS_PATH), sd->param, sizeof(sd->param));
|
||||
lfn[sizeof(SOUNDS_PATH)+sizeof(sd->param)] = '\0';
|
||||
strcat(lfn+sizeof(SOUNDS_PATH), SOUNDS_EXT);
|
||||
audioQueue.playFile(lfn);
|
||||
}
|
||||
else {
|
||||
playValue(FSW_PARAM(sd));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sd->func == FUNC_VOLUME) {
|
||||
|
||||
+1
-1
@@ -412,7 +412,7 @@ extern const pm_char STR_THROTTLEWARN[];
|
||||
extern const pm_char STR_ALARMSWARN[];
|
||||
extern const pm_char STR_SWITCHWARN[];
|
||||
|
||||
#if defined(SOMO)
|
||||
#if defined(SOMO) || defined(PCBARM)
|
||||
void playNumber(int16_t number, uint8_t unit=0, uint8_t att=0);
|
||||
void playDuration(int16_t seconds);
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@ enum EnglishPrompts {
|
||||
PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
};
|
||||
|
||||
#if defined(SOMO)
|
||||
#if defined(SOMO) || defined(PCBARM)
|
||||
|
||||
void playNumber(int16_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
#if defined(SDCARD)
|
||||
#define TR_SDCLOGS "[SDCARD Logs]"
|
||||
#define TR_PLAY_TRACK "Play Track\0 "
|
||||
#define TR_PLAY_VALUE "[Play Value]\0"
|
||||
#define TR_PLAY_VALUE "Play Value\0 "
|
||||
#else
|
||||
#define TR_SDCLOGS "[SDCARD Logs]"
|
||||
#define TR_PLAY_TRACK "[Play Track]\0"
|
||||
|
||||
@@ -63,7 +63,7 @@ enum FrenchPrompts {
|
||||
PROMPT_MILLIAMPS = PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
};
|
||||
|
||||
#if defined(SOMO)
|
||||
#if defined(SOMO) || defined(PCBARM)
|
||||
|
||||
void playNumber(int16_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
#if defined(SDCARD)
|
||||
#define TR_SDCLOGS "[SDCARD Logs]"
|
||||
#define TR_PLAY_TRACK "Play Track\0 "
|
||||
#define TR_PLAY_VALUE "[Play Value]\0"
|
||||
#define TR_PLAY_VALUE "Play Value\0 "
|
||||
#else
|
||||
#define TR_SDCLOGS "[SDCARD Logs]"
|
||||
#define TR_PLAY_TRACK "[Play Track]\0"
|
||||
|
||||
Reference in New Issue
Block a user