From 2037f0d8b0eb68833701f5ed62afe2fa5936fa0f Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 10 Dec 2012 10:30:54 +0000 Subject: [PATCH] [stock / gruvin9x] FrSky and DSM2 serial mode [Sky9x] Bootloader mode on REVC --- src/board_sky9x.cpp | 6 +---- src/board_sky9x.h | 7 ++---- src/eeprom_arm.cpp | 16 ++++++++------ src/eeprom_avr.cpp | 6 +++-- src/model_menus.cpp | 3 --- src/open9x.cpp | 54 +++++++++++++-------------------------------- src/open9x.h | 1 - src/pulses_avr.cpp | 12 ++++++++++ 8 files changed, 43 insertions(+), 62 deletions(-) diff --git a/src/board_sky9x.cpp b/src/board_sky9x.cpp index 0c676947f..c58b6a3a0 100644 --- a/src/board_sky9x.cpp +++ b/src/board_sky9x.cpp @@ -69,10 +69,6 @@ inline void init_soft_power() } #endif -#if defined(REVC) -bool bootloader_allowed = true; -#endif - uint32_t check_soft_power() { #ifdef SIMU @@ -1267,7 +1263,7 @@ void end_bt_tx_interrupt() NVIC_DisableIRQ(UART1_IRQn) ; } -void usb_mode() +void usbBootloader() { // This might be replaced by a software reset // Any interrupts that have been enabled must be disabled here diff --git a/src/board_sky9x.h b/src/board_sky9x.h index e3e5b9ac3..9e7196249 100644 --- a/src/board_sky9x.h +++ b/src/board_sky9x.h @@ -100,12 +100,9 @@ extern uint16_t sessionTimer; #endif #if defined(REVC) -extern bool bootloader_allowed; -#define SKIP_INIT() (check_soft_power() == e_power_off || (bootloader_allowed && usbPlugged())) -#define BOOTLOADER_REQ() (bootloader_allowed && usbPlugged()) +#define BOOTLOADER_REQUEST() (usbPlugged()) #else -#define SKIP_INIT() (check_soft_power() >= e_power_usb) -#define BOOTLOADER_REQ() (check_soft_power() == e_power_usb) +#define BOOTLOADER_REQUEST() (check_soft_power() == e_power_usb) #endif #define SLAVE_MODE() (check_soft_power() == e_power_trainer) diff --git a/src/eeprom_arm.cpp b/src/eeprom_arm.cpp index 96fccf6b1..226de7438 100644 --- a/src/eeprom_arm.cpp +++ b/src/eeprom_arm.cpp @@ -500,8 +500,6 @@ void eeLoadModel(uint8_t id) activeFunctions = 0; activeFunctionSwitches = 0; - resetProto(); - for (uint8_t i=0; i