1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 09:45:21 +03:00

[stock] Volume mod: volume was not set at Tx startup

This commit is contained in:
bsongis 2012-09-14 18:38:32 +00:00
parent 956d034fdc
commit 1e69cfa94a
5 changed files with 11 additions and 7 deletions

View file

@ -241,12 +241,9 @@ void menuProcSetup(uint8_t event)
lcd_outdezAtt(GENERAL_PARAM_OFS, y, b, attr|LEFT); lcd_outdezAtt(GENERAL_PARAM_OFS, y, b, attr|LEFT);
if (attr) { if (attr) {
CHECK_INCDEC_GENVAR(event, b, 0, 7); 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; g_eeGeneral.speakerVolume = (int8_t)b-7;
#if defined(PCBSTD) SET_VOLUME(b);
// TODO do the same on V4 Board with SOMO-14D ... with a #define ...
pushCustomPrompt(b | 0xF0);
#endif
} }
} }
#endif #endif
@ -254,7 +251,7 @@ void menuProcSetup(uint8_t event)
} }
#endif #endif
#ifdef HAPTIC #if defined(HAPTIC)
case ITEM_SETUP_HAPTIC_MODE: case ITEM_SETUP_HAPTIC_MODE:
g_eeGeneral.hapticMode = selectMenuItem(GENERAL_PARAM_OFS, y, STR_HAPTICMODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event); g_eeGeneral.hapticMode = selectMenuItem(GENERAL_PARAM_OFS, y, STR_HAPTICMODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event);
break; break;

View file

@ -44,3 +44,5 @@ extern bool isPlaying(uint8_t id);
#define PLAY_DURATION(d) playDuration((d), id) #define PLAY_DURATION(d) playDuration((d), id)
#define IS_PLAYING(id) isPlaying((id)) #define IS_PLAYING(id) isPlaying((id))
#define PLAY_VALUE(v, id) playValue((v), (id)) #define PLAY_VALUE(v, id) playValue((v), (id))
#define SET_VOLUME(v)

View file

@ -3208,6 +3208,8 @@ inline void open9xInit(OPEN9X_INIT_ARGS)
#if defined(PCBARM) #if defined(PCBARM)
setVolume(g_eeGeneral.speakerVolume); setVolume(g_eeGeneral.speakerVolume);
PWM->PWM_CH_NUM[0].PWM_CDTYUPD = g_eeGeneral.backlightBright; PWM->PWM_CH_NUM[0].PWM_CDTYUPD = g_eeGeneral.backlightBright;
#elif defined(VOICE)
SET_VOLUME(g_eeGeneral.speakerVolume+7);
#endif #endif
#if defined(PCBARM) && defined(BLUETOOTH) #if defined(PCBARM) && defined(BLUETOOTH)

View file

@ -119,7 +119,8 @@ void t_voice::voice_process(void)
// delay to allow input to settle // delay to allow input to settle
asm(" nop"); asm(" nop");
asm(" nop"); asm(" nop");
asm(" nop") ; asm(" nop");
asm(" nop");
#endif #endif
busy = PINB & 0x80; busy = PINB & 0x80;
DDRB |= (1 << OUT_B_LIGHT); // Change to output DDRB |= (1 << OUT_B_LIGHT); // Change to output

View file

@ -73,6 +73,8 @@ extern void pushPrompt( uint8_t value );
extern struct t_voice *voiceaddress( void ) ; extern struct t_voice *voiceaddress( void ) ;
extern struct t_voice Voice ; extern struct t_voice Voice ;
#define SET_VOLUME(v) pushCustomPrompt((v) | 0xF0)
inline bool isPlaying() inline bool isPlaying()
{ {
#if defined(SIMU) #if defined(SIMU)