[Taranis] EEPROM disconnected when Massstorage is active

This commit is contained in:
bsongis@gmail.com
2013-04-01 20:49:48 +00:00
parent 1a7bb8e966
commit 5126de7ed8
8 changed files with 26 additions and 8 deletions
+4
View File
@@ -961,6 +961,10 @@ void eeReadAll()
void eeCheck(bool immediately) void eeCheck(bool immediately)
{ {
if (EEPROM_MASSSTORAGE()) {
return;
}
if (immediately) { if (immediately) {
eeFlush(); eeFlush();
} }
+2
View File
@@ -180,4 +180,6 @@ void sdPoll10ms();
uint8_t pwrCheck(); uint8_t pwrCheck();
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown) #define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
#define EEPROM_MASSSTORAGE() (0)
#endif #endif
+2
View File
@@ -47,4 +47,6 @@ void sdPoll10ms();
uint8_t pwrCheck(); uint8_t pwrCheck();
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown) #define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
#define EEPROM_MASSSTORAGE() (0)
#endif #endif
+9 -2
View File
@@ -3453,8 +3453,15 @@ void perMain()
lcd_clear(); lcd_clear();
const char *warn = s_warning; const char *warn = s_warning;
g_menuStack[g_menuStackPtr](warn ? 0 : evt);
if (warn) displayWarning(evt); if (EEPROM_MASSSTORAGE()) {
menuMainView(0);
}
else {
g_menuStack[g_menuStackPtr](warn ? 0 : evt);
if (warn) displayWarning(evt);
}
drawStatusLine(); drawStatusLine();
lcdRefresh(); lcdRefresh();
+1
View File
@@ -235,6 +235,7 @@ uint32_t pwrCheck();
// EEPROM driver // EEPROM driver
void eepromInit(); void eepromInit();
#define EEPROM_MASSSTORAGE() (0)
// Rotary Encoder driver // Rotary Encoder driver
void rotencInit(); void rotencInit();
+2
View File
@@ -215,4 +215,6 @@ extern uint8_t RotEncoder ;
void rotencPoll(); void rotencPoll();
#endif #endif
#define EEPROM_MASSSTORAGE() (0)
#endif #endif
+5 -3
View File
@@ -166,6 +166,10 @@ void pwrOff();
#define __BACKLIGHT_OFF GPIO_ResetBits(GPIOB, GPIO_Pin_BL) #define __BACKLIGHT_OFF GPIO_ResetBits(GPIOB, GPIO_Pin_BL)
#define IS_BACKLIGHT_ON() GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_BL) #define IS_BACKLIGHT_ON() GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_BL)
// USB driver
void usbInit(void);
extern uint8_t usb_connected;
// EEPROM driver // EEPROM driver
#if !defined(SIMU) #if !defined(SIMU)
#define eepromInit() I2C_EE_Init() #define eepromInit() I2C_EE_Init()
@@ -175,8 +179,6 @@ void pwrOff();
#define eepromInit() #define eepromInit()
void eeWriteBlockCmp(const void *pointer_ram, uint16_t pointer_eeprom, size_t size); void eeWriteBlockCmp(const void *pointer_ram, uint16_t pointer_eeprom, size_t size);
#endif #endif
#define EEPROM_MASSSTORAGE() (usb_connected)
// USB driver
void usbInit(void);
#endif #endif
-2
View File
@@ -28,8 +28,6 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "../opentx.h" #include "../opentx.h"
extern uint8_t usb_connected;
extern "C" { extern "C" {
#include "usbd_usr.h" #include "usbd_usr.h"