[Taranis] USB bug fixes

[Taranis] DSM2 continued
This commit is contained in:
bsongis@gmail.com
2013-06-26 15:22:21 +00:00
parent b1389ee87a
commit b15030afc3
8 changed files with 25 additions and 25 deletions
-4
View File
@@ -1028,10 +1028,6 @@ void eeReadAll()
void eeCheck(bool immediately) void eeCheck(bool immediately)
{ {
if (EEPROM_MASSSTORAGE()) {
return;
}
if (immediately) { if (immediately) {
eeFlush(); eeFlush();
} }
+15 -13
View File
@@ -3635,25 +3635,27 @@ void perMain()
} }
#endif #endif
// TODO merge these 2 branches if (!usbPlugged()) {
// TODO merge these 2 branches
#if defined(PCBSKY9X) #if defined(PCBSKY9X)
if (Eeprom32_process_state != E32_IDLE) if (Eeprom32_process_state != E32_IDLE)
ee32_process(); ee32_process();
else if (TIME_TO_WRITE()) else if (TIME_TO_WRITE())
eeCheck(false); eeCheck(false);
#elif defined(CPUARM) #elif defined(CPUARM)
if (theFile.isWriting())
theFile.nextWriteStep();
else if (TIME_TO_WRITE())
eeCheck(false);
#else
if (!eeprom_buffer_size) {
if (theFile.isWriting()) if (theFile.isWriting())
theFile.nextWriteStep(); theFile.nextWriteStep();
else if (TIME_TO_WRITE()) else if (TIME_TO_WRITE())
eeCheck(false); eeCheck(false);
} #else
if (!eeprom_buffer_size) {
if (theFile.isWriting())
theFile.nextWriteStep();
else if (TIME_TO_WRITE())
eeCheck(false);
}
#endif #endif
}
#if defined(SDCARD) #if defined(SDCARD)
sdMountPoll(); sdMountPoll();
@@ -3773,7 +3775,7 @@ void perMain()
const char *warn = s_warning; const char *warn = s_warning;
uint8_t menu = s_menu_count; uint8_t menu = s_menu_count;
if (EEPROM_MASSSTORAGE()) { if (usbPlugged()) {
menuMainView(0); menuMainView(0);
} }
else { else {
+3 -3
View File
@@ -72,17 +72,17 @@ void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1
len += BITLEN_DSM2; len += BITLEN_DSM2;
} }
else { else {
_send_1(nlev ? len-5 : len+3); _send_1(len); // _send_1(nlev ? len-5 : len+3);
len = BITLEN_DSM2; len = BITLEN_DSM2;
lev = nlev; lev = nlev;
} }
b = (b>>1) | 0x80; //shift in stop bit b = (b>>1) | 0x80; //shift in stop bit
} }
_send_1(len+BITLEN_DSM2+3); // 2 stop bits _send_1(len+BITLEN_DSM2); // _send_1(len+BITLEN_DSM2+3); // 2 stop bits
} }
void putDsm2Flush() void putDsm2Flush()
{ {
dsm2StreamPtr--; //remove last stopbits and // dsm2StreamPtr--; //remove last stopbits and
*dsm2StreamPtr++ = 44010; // Past the 44000 of the ARR *dsm2StreamPtr++ = 44010; // Past the 44000 of the ARR
} }
#else #else
+3 -1
View File
@@ -85,6 +85,7 @@
bool sdMounted(); bool sdMounted();
void sdMountPoll(); void sdMountPoll();
void sdPoll10ms(); void sdPoll10ms();
#define sdDone()
#define SD_IS_HC() (0) #define SD_IS_HC() (0)
#define SD_GET_BLOCKNR() (0) #define SD_GET_BLOCKNR() (0)
@@ -179,7 +180,8 @@ uint8_t pwrCheck();
void pwrOff(); void pwrOff();
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown) #define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
#define EEPROM_MASSSTORAGE() (0) // USB fake driver
#define usbPlugged() false
// Haptic driver // Haptic driver
#define hapticOff() // TODO hapticOn() cleaner ... #define hapticOff() // TODO hapticOn() cleaner ...
+2 -1
View File
@@ -45,6 +45,7 @@ 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) // USB fake driver
#define usbPlugged() false
#endif #endif
-1
View File
@@ -244,7 +244,6 @@ 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 -1
View File
@@ -229,6 +229,7 @@ extern uint8_t RotEncoder ;
void rotencPoll(); void rotencPoll();
#endif #endif
#define EEPROM_MASSSTORAGE() (0) // USB fake driver
#define usbPlugged() false
#endif #endif
-1
View File
@@ -172,7 +172,6 @@ void pwrOff();
void usbInit(void); void usbInit(void);
void usbStart(void); void usbStart(void);
bool usbPlugged(void); bool usbPlugged(void);
#define EEPROM_MASSSTORAGE() usbPlugged()
// EEPROM driver // EEPROM driver
#if !defined(SIMU) #if !defined(SIMU)