diff --git a/src/board_ersky9x.cpp b/src/board_ersky9x.cpp index df3e76beb..d625b0196 100644 --- a/src/board_ersky9x.cpp +++ b/src/board_ersky9x.cpp @@ -77,21 +77,33 @@ uint32_t check_soft_power() return e_power_on; #endif - if ( PIOC->PIO_PDSR & 0x02000000 ) - { - return e_power_usb ; // Detected USB - } - #ifdef REVB if ( PIOC->PIO_PDSR & PIO_PC17 ) // Power on { return e_power_on ; } + if ( PIOC->PIO_PDSR & PIO_PC25 ) + { + return e_power_usb ; // Detected USB + } + if ( PIOA->PIO_PDSR & PIO_PA8 ) // Trainer plugged in { return e_power_trainer ; } +#else + if ( PIOC->PIO_PDSR & PIO_PC25 ) + { + return e_power_usb ; // Detected USB + } + + if ( PIOA->PIO_PDSR & PIO_PA8 ) // Trainer plugged in + { + return e_power_trainer ; + } + + return e_power_on; #endif return e_power_off; diff --git a/src/stock/audio.h b/src/stock/audio.h index ac0afd662..915784f2b 100644 --- a/src/stock/audio.h +++ b/src/stock/audio.h @@ -121,7 +121,7 @@ void audioDefevent(uint8_t e); #define AUDIO_TADA() pushPrompt(PROMPT_SYSTEM_BASE+AU_TADA) #define AUDIO_TX_BATTERY_LOW() pushPrompt(PROMPT_SYSTEM_BASE+AU_TX_BATTERY_LOW) #define AUDIO_INACTIVITY() pushPrompt(PROMPT_SYSTEM_BASE+AU_INACTIVITY) -#define AUDIO_ERROR_MESSAGE(e) pushPrompt(PROMPT_SYSTEM_BASE+e) +#define AUDIO_ERROR_MESSAGE(e) pushPrompt(PROMPT_SYSTEM_BASE+(e)) #define AUDIO_TIMER_30() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_30) #define AUDIO_TIMER_20() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_20) #define AUDIO_TIMER_10() pushPrompt(PROMPT_SYSTEM_BASE+AU_TIMER_10)