diff --git a/src/general_menus.cpp b/src/general_menus.cpp index 4aa1fd88d..b44dbb43d 100644 --- a/src/general_menus.cpp +++ b/src/general_menus.cpp @@ -241,12 +241,9 @@ void menuProcSetup(uint8_t event) lcd_outdezAtt(GENERAL_PARAM_OFS, y, b, attr|LEFT); if (attr) { CHECK_INCDEC_GENVAR(event, b, 0, 7); - if (g_eeGeneral.speakerVolume != (int8_t)b-7) { + if (checkIncDec_Ret) { g_eeGeneral.speakerVolume = (int8_t)b-7; -#if defined(PCBSTD) - // TODO do the same on V4 Board with SOMO-14D ... with a #define ... - pushCustomPrompt(b | 0xF0); -#endif + SET_VOLUME(b); } } #endif @@ -254,7 +251,7 @@ void menuProcSetup(uint8_t event) } #endif -#ifdef HAPTIC +#if defined(HAPTIC) case ITEM_SETUP_HAPTIC_MODE: g_eeGeneral.hapticMode = selectMenuItem(GENERAL_PARAM_OFS, y, STR_HAPTICMODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event); break; diff --git a/src/gruvin9x/somo14d.h b/src/gruvin9x/somo14d.h index d03a690d2..bdd7f4f52 100644 --- a/src/gruvin9x/somo14d.h +++ b/src/gruvin9x/somo14d.h @@ -44,3 +44,5 @@ extern bool isPlaying(uint8_t id); #define PLAY_DURATION(d) playDuration((d), id) #define IS_PLAYING(id) isPlaying((id)) #define PLAY_VALUE(v, id) playValue((v), (id)) + +#define SET_VOLUME(v) diff --git a/src/open9x.cpp b/src/open9x.cpp index b56abe437..b7f61d5dd 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -3208,6 +3208,8 @@ inline void open9xInit(OPEN9X_INIT_ARGS) #if defined(PCBARM) setVolume(g_eeGeneral.speakerVolume); PWM->PWM_CH_NUM[0].PWM_CDTYUPD = g_eeGeneral.backlightBright; +#elif defined(VOICE) + SET_VOLUME(g_eeGeneral.speakerVolume+7); #endif #if defined(PCBARM) && defined(BLUETOOTH) diff --git a/src/stock/voice.cpp b/src/stock/voice.cpp index 9765b5fc6..e53b258d8 100644 --- a/src/stock/voice.cpp +++ b/src/stock/voice.cpp @@ -119,7 +119,8 @@ void t_voice::voice_process(void) // delay to allow input to settle asm(" nop"); asm(" nop"); - asm(" nop") ; + asm(" nop"); + asm(" nop"); #endif busy = PINB & 0x80; DDRB |= (1 << OUT_B_LIGHT); // Change to output diff --git a/src/stock/voice.h b/src/stock/voice.h index afc53ab0d..52b8aede3 100644 --- a/src/stock/voice.h +++ b/src/stock/voice.h @@ -73,6 +73,8 @@ extern void pushPrompt( uint8_t value ); extern struct t_voice *voiceaddress( void ) ; extern struct t_voice Voice ; +#define SET_VOLUME(v) pushCustomPrompt((v) | 0xF0) + inline bool isPlaying() { #if defined(SIMU)