Little pause ;) Using unions in EEPROM is not a very good idea for Linux / Windows interoperability
This commit is contained in:
@@ -359,7 +359,7 @@ void audioEvent(uint8_t e, uint8_t f)
|
|||||||
break;
|
break;
|
||||||
// error
|
// error
|
||||||
case AU_ERROR:
|
case AU_ERROR:
|
||||||
play(BEEP_DEFAULT_FREQ, 80, 2, PLAY_NOW);
|
play(BEEP_DEFAULT_FREQ, 50, 2, PLAY_NOW);
|
||||||
break;
|
break;
|
||||||
// keypad up (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
// keypad up (seems to be used when going left/right through system menu options. 0-100 scales etc)
|
||||||
case AU_KEYPAD_UP:
|
case AU_KEYPAD_UP:
|
||||||
@@ -391,7 +391,7 @@ void audioEvent(uint8_t e, uint8_t f)
|
|||||||
break;
|
break;
|
||||||
// warning three
|
// warning three
|
||||||
case AU_WARNING3:
|
case AU_WARNING3:
|
||||||
play(BEEP_DEFAULT_FREQ, 60, 2, PLAY_NOW);
|
play(BEEP_DEFAULT_FREQ, 50, 2, PLAY_NOW);
|
||||||
break;
|
break;
|
||||||
// startup tune
|
// startup tune
|
||||||
case AU_TADA:
|
case AU_TADA:
|
||||||
|
|||||||
+2
-2
@@ -2280,7 +2280,7 @@ void menuProcFunctionSwitches(uint8_t event)
|
|||||||
#endif
|
#endif
|
||||||
#if defined(PCBARM) && defined(SDCARD)
|
#if defined(PCBARM) && defined(SDCARD)
|
||||||
else if (sd->func == FUNC_PLAY_TRACK) {
|
else if (sd->func == FUNC_PLAY_TRACK) {
|
||||||
lcd_putsnAtt(15*FW, y, sd->param.name, sizeof(sd->param.name), attr);
|
lcd_putsnAtt(15*FW, y, sd->param, sizeof(sd->param), attr);
|
||||||
if (active && event==EVT_KEY_BREAK(KEY_MENU)) {
|
if (active && event==EVT_KEY_BREAK(KEY_MENU)) {
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT)) {
|
if (!listSdFiles(SOUNDS_PATH, SOUNDS_EXT)) {
|
||||||
@@ -2363,7 +2363,7 @@ void menuProcFunctionSwitches(uint8_t event)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// The user choosed a wav file in the list
|
// The user choosed a wav file in the list
|
||||||
memcpy(g_model.funcSw[sub].param.name, result, sizeof(g_model.funcSw[sub].param.name));
|
memcpy(g_model.funcSw[sub].param, result, sizeof(g_model.funcSw[sub].param));
|
||||||
eeDirty(EE_MODEL);
|
eeDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-5
@@ -326,12 +326,9 @@ enum Functions {
|
|||||||
PACK(typedef struct t_FuncSwData { // Function Switches data
|
PACK(typedef struct t_FuncSwData { // Function Switches data
|
||||||
int8_t swtch; //input
|
int8_t swtch; //input
|
||||||
uint8_t func;
|
uint8_t func;
|
||||||
union {
|
char param[6];
|
||||||
uint32_t value;
|
|
||||||
char name[6];
|
|
||||||
} param;
|
|
||||||
}) FuncSwData;
|
}) FuncSwData;
|
||||||
#define FSW_PARAM(p) ((p)->param.value)
|
#define FSW_PARAM(p) (*((uint32_t*)(p)->param))
|
||||||
#else
|
#else
|
||||||
PACK(typedef struct t_FuncSwData { // Function Switches data
|
PACK(typedef struct t_FuncSwData { // Function Switches data
|
||||||
int8_t swtch; //input
|
int8_t swtch; //input
|
||||||
|
|||||||
+2
-2
@@ -1689,13 +1689,13 @@ void evalFunctions()
|
|||||||
else if (sd->func == FUNC_PLAY_TRACK) {
|
else if (sd->func == FUNC_PLAY_TRACK) {
|
||||||
if (!audioBusy()) {
|
if (!audioBusy()) {
|
||||||
char lfn[32] = SOUNDS_PATH "/";
|
char lfn[32] = SOUNDS_PATH "/";
|
||||||
strcat(lfn, sd->param.name);
|
strcat(lfn, sd->param);
|
||||||
strcat(lfn, SOUNDS_EXT);
|
strcat(lfn, SOUNDS_EXT);
|
||||||
playFile(lfn);
|
playFile(lfn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sd->func == FUNC_VOLUME) {
|
else if (sd->func == FUNC_VOLUME) {
|
||||||
requiredSpeakerVolume = ((1024 + getValue(sd->param.value)) * NUM_VOL_LEVELS) / 2048;
|
requiredSpeakerVolume = ((1024 + getValue(FSW_PARAM(sd))) * NUM_VOL_LEVELS) / 2048;
|
||||||
}
|
}
|
||||||
#elif defined(SOMO)
|
#elif defined(SOMO)
|
||||||
else if (sd->func == FUNC_PLAY_TRACK || sd->func == FUNC_PLAY_VALUE) {
|
else if (sd->func == FUNC_PLAY_TRACK || sd->func == FUNC_PLAY_VALUE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user