diff --git a/src/general_menus.cpp b/src/general_menus.cpp index 843990be7..a06cfda53 100644 --- a/src/general_menus.cpp +++ b/src/general_menus.cpp @@ -401,11 +401,11 @@ void menuGeneralSetup(uint8_t event) if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5); break; -#if defined(SPLASH) +#if defined(SPLASH) && !defined(FSPLASH) case ITEM_SETUP_DISABLE_SPLASH: { - uint8_t b = 1-g_eeGeneral.disableSplashScreen; - g_eeGeneral.disableSplashScreen = 1 - onoffMenuItem( b, RADIO_SETUP_2ND_COLUMN, y, STR_SPLASHSCREEN, attr, event ) ; + uint8_t b = 1-g_eeGeneral.splashMode; + g_eeGeneral.splashMode = 1 - onoffMenuItem( b, RADIO_SETUP_2ND_COLUMN, y, STR_SPLASHSCREEN, attr, event ) ; break; } #endif diff --git a/src/myeeprom.h b/src/myeeprom.h index 1c149d5cd..d53a1d342 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -102,7 +102,8 @@ enum BeeperMode { uint16_t mAhUsed; \ uint32_t globalTimer; \ int8_t temperatureCalib; \ - uint8_t btBaudrate + uint8_t btBaudrate; \ + uint8_t optrexDisplay #else #define EXTRA_SKY9X_FIELDS #define EXTRA_GENERAL_FIELDS \ @@ -123,6 +124,13 @@ enum BacklightMode { e_backlight_mode_on }; +#if defined(FSPLASH) || defined(XSPLASH) +#define SPLASH_MODE uint8_t splashMode:3 +#else +#define SPLASH_MODE uint8_t splashMode:1; \ +uint8_t spare4:2 +#endif + #define ALTERNATE_VIEW 0x10 PACK(typedef struct t_EEGeneral { uint8_t version; @@ -140,19 +148,17 @@ PACK(typedef struct t_EEGeneral { uint8_t view; //index of subview in main scrren int8_t spare1:3; int8_t beeperMode:2; - uint8_t spare2:1; + uint8_t flashBeep:1; uint8_t disableMemoryWarning:1; uint8_t disableAlarmWarning:1; uint8_t stickMode:2; int8_t timezone:5; - uint8_t optrexDisplay:1; + uint8_t spare2:1; uint8_t inactivityTimer; uint8_t throttleReversed:1; uint8_t minuteBeep:1; uint8_t preBeep:1; - uint8_t flashBeep:1; - uint8_t disableSplashScreen:1; - uint8_t spare3:1; + SPLASH_MODE; /* 3bits */ int8_t hapticMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all uint8_t filterInput; uint8_t lightAutoOff; diff --git a/src/open9x.cpp b/src/open9x.cpp index f4fb1fa04..15d6d4573 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -1077,13 +1077,9 @@ void backlightOn() g_LightOffCounter = ((uint16_t)g_eeGeneral.lightAutoOff*250) << 1; } -#ifdef SPLASH +#if defined(SPLASH) -#ifdef DSM2 -#define SPLASH_NEEDED() (g_model.protocol != PROTO_DSM2 && !g_eeGeneral.disableSplashScreen) -#else -#define SPLASH_NEEDED() (!g_eeGeneral.disableSplashScreen) -#endif +#define SPLASH_NEEDED() (!IS_DSM2_PROTOCOL(g_model.protocol) && !g_eeGeneral.splashMode) void doSplash() { @@ -1105,7 +1101,7 @@ void doSplash() #endif #if !defined(SIMU) - for(uint8_t i=0; i<32; i++) + for (uint8_t i=0; i<32; i++) getADC_filt(); // init ADC array #endif @@ -1124,9 +1120,12 @@ void doSplash() uint16_t tsum = stickMoveValue(); - if(keyDown() || (tsum!=inacSum)) return; //wait for key release +#if defined(FSPLASH) || defined(XSPLASH) + if (!(g_eeGeneral.splashMode & 0x04)) +#endif + if (keyDown() || (tsum!=inacSum)) return; // wait for key release - if (check_soft_power() > e_power_trainer) return; // Usb on or power off + if (check_soft_power() > e_power_trainer) return; // usb and power off #if !defined(PCBSTD) if (curTime < get_tmr10ms()) { diff --git a/src/open9x.h b/src/open9x.h index 1ec4b9f30..be113fa6f 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -581,7 +581,11 @@ enum CswFunctions { #define DSW_SWC 21 #define THRCHK_DEADBAND 16 +#if defined(FSPLASH) || defined(XSPLASH) +#define SPLASH_TIMEOUT (g_eeGeneral.splashMode == 0 ? 60000/*infinite=10mn*/ : ((4*100) * (g_eeGeneral.splashMode & 0x03))) +#else #define SPLASH_TIMEOUT (4*100) // 4 seconds +#endif #define TRM_BASE TRM_LH_DWN diff --git a/src/stock/voice.cpp b/src/stock/voice.cpp index f503d67ac..99ecac599 100644 --- a/src/stock/voice.cpp +++ b/src/stock/voice.cpp @@ -35,19 +35,7 @@ struct t_voice Voice ; -void pushCustomPrompt(uint8_t value) -{ - struct t_voice *vptr ; - vptr = voiceaddress() ; - - if (vptr->VoiceQueueCount < VOICE_Q_LENGTH-1) - { - pushPrompt( 0xFF ) ; - pushPrompt( value ) ; - } -} - -void pushPrompt(uint8_t value) +void pushPrompt16(uint16_t value) { #ifdef SIMU printf("playFile(\"%04d.ad4\")\n", value); fflush(stdout); @@ -58,11 +46,21 @@ void pushPrompt(uint8_t value) if (vptr->VoiceQueueCount < VOICE_Q_LENGTH) { vptr->VoiceQueue[vptr->VoiceQueueInIndex++] = value; - vptr->VoiceQueueInIndex &= (VOICE_Q_LENGTH - 1); + vptr->VoiceQueueInIndex &= (VOICE_Q_LENGTH - 1); // TODO flash saving? vptr->VoiceQueueCount += 1; } } +void pushCustomPrompt(uint8_t value) +{ + pushPrompt16(260+value); +} + +void pushPrompt(uint8_t value) +{ + pushPrompt16(value); +} + struct t_voice *voiceaddress() { return &Voice ; @@ -79,19 +77,10 @@ void t_voice::voice_process(void) PORTB |= (1 << OUT_B_LIGHT); // Latch clock high if (VoiceQueueCount) { VoiceSerial = VoiceQueue[VoiceQueueOutIndex++]; - VoiceQueueOutIndex &= (VOICE_Q_LENGTH - 1); + VoiceQueueOutIndex &= (VOICE_Q_LENGTH - 1); // TODO flash saving VoiceQueueCount -= 1; - if (VoiceShift) { - VoiceShift = 0; - VoiceSerial += 256; - } - VoiceTimer = 16; - if (VoiceSerial == 0xFF) { // Looking for Shift FF - VoiceShift = 1; - return; - } - if ((VoiceSerial & 0x1F8) == 0x1F0) { // Looking for sound volume 1F0-1F7 - VoiceSerial |= 0xFF00; + VoiceTimer = 17; + if (VoiceSerial & 0x8000) { // Looking for sound volume 1F0-1F7 VoiceTimer = 40; } VoiceLatch &= ~VOICE_CLOCK_BIT & ~VOICE_DATA_BIT ; @@ -109,9 +98,13 @@ void t_voice::voice_process(void) } } else if (VoiceState == V_STARTUP) { - if (g_blinkTmr10ms > 150) { // Give module 1.5 secs to initialise - VoiceState = V_IDLE; + PORTB |= (1< 60) { // Give module 1.4 secs to initialise + VoiceState = V_WAIT_START_BUSY_OFF ; } + PORTB &= ~(1<