Play Custom functions with no file selected slowed down the radio
This commit is contained in:
@@ -3353,6 +3353,7 @@ uint8_t fnSwitchDuration[NUM_CFN] = { 0 };
|
|||||||
|
|
||||||
inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
|
inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
|
||||||
{
|
{
|
||||||
|
if (sd->play.name[0] != '\0') {
|
||||||
char filename[sizeof(SOUNDS_PATH)+sizeof(sd->play.name)+sizeof(SOUNDS_EXT)] = SOUNDS_PATH "/";
|
char filename[sizeof(SOUNDS_PATH)+sizeof(sd->play.name)+sizeof(SOUNDS_EXT)] = SOUNDS_PATH "/";
|
||||||
strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2);
|
strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2);
|
||||||
strncpy(filename+sizeof(SOUNDS_PATH), sd->play.name, sizeof(sd->play.name));
|
strncpy(filename+sizeof(SOUNDS_PATH), sd->play.name, sizeof(sd->play.name));
|
||||||
@@ -3360,6 +3361,7 @@ inline void playCustomFunctionFile(CustomFnData *sd, uint8_t id)
|
|||||||
strcat(filename+sizeof(SOUNDS_PATH), SOUNDS_EXT);
|
strcat(filename+sizeof(SOUNDS_PATH), SOUNDS_EXT);
|
||||||
PLAY_FILE(filename, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id);
|
PLAY_FILE(filename, sd->func==FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
|||||||
Reference in New Issue
Block a user