[Taranis] USB bug fixes
[Taranis] DSM2 continued
This commit is contained in:
@@ -1028,10 +1028,6 @@ void eeReadAll()
|
||||
|
||||
void eeCheck(bool immediately)
|
||||
{
|
||||
if (EEPROM_MASSSTORAGE()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (immediately) {
|
||||
eeFlush();
|
||||
}
|
||||
|
||||
+15
-13
@@ -3635,25 +3635,27 @@ void perMain()
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO merge these 2 branches
|
||||
if (!usbPlugged()) {
|
||||
// TODO merge these 2 branches
|
||||
#if defined(PCBSKY9X)
|
||||
if (Eeprom32_process_state != E32_IDLE)
|
||||
ee32_process();
|
||||
else if (TIME_TO_WRITE())
|
||||
eeCheck(false);
|
||||
if (Eeprom32_process_state != E32_IDLE)
|
||||
ee32_process();
|
||||
else if (TIME_TO_WRITE())
|
||||
eeCheck(false);
|
||||
#elif defined(CPUARM)
|
||||
if (theFile.isWriting())
|
||||
theFile.nextWriteStep();
|
||||
else if (TIME_TO_WRITE())
|
||||
eeCheck(false);
|
||||
#else
|
||||
if (!eeprom_buffer_size) {
|
||||
if (theFile.isWriting())
|
||||
theFile.nextWriteStep();
|
||||
else if (TIME_TO_WRITE())
|
||||
eeCheck(false);
|
||||
}
|
||||
#else
|
||||
if (!eeprom_buffer_size) {
|
||||
if (theFile.isWriting())
|
||||
theFile.nextWriteStep();
|
||||
else if (TIME_TO_WRITE())
|
||||
eeCheck(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
sdMountPoll();
|
||||
@@ -3773,7 +3775,7 @@ void perMain()
|
||||
const char *warn = s_warning;
|
||||
uint8_t menu = s_menu_count;
|
||||
|
||||
if (EEPROM_MASSSTORAGE()) {
|
||||
if (usbPlugged()) {
|
||||
menuMainView(0);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -72,17 +72,17 @@ void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1
|
||||
len += BITLEN_DSM2;
|
||||
}
|
||||
else {
|
||||
_send_1(nlev ? len-5 : len+3);
|
||||
_send_1(len); // _send_1(nlev ? len-5 : len+3);
|
||||
len = BITLEN_DSM2;
|
||||
lev = nlev;
|
||||
}
|
||||
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()
|
||||
{
|
||||
dsm2StreamPtr--; //remove last stopbits and
|
||||
// dsm2StreamPtr--; //remove last stopbits and
|
||||
*dsm2StreamPtr++ = 44010; // Past the 44000 of the ARR
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
bool sdMounted();
|
||||
void sdMountPoll();
|
||||
void sdPoll10ms();
|
||||
#define sdDone()
|
||||
|
||||
#define SD_IS_HC() (0)
|
||||
#define SD_GET_BLOCKNR() (0)
|
||||
@@ -179,7 +180,8 @@ uint8_t pwrCheck();
|
||||
void pwrOff();
|
||||
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
|
||||
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
// USB fake driver
|
||||
#define usbPlugged() false
|
||||
|
||||
// Haptic driver
|
||||
#define hapticOff() // TODO hapticOn() cleaner ...
|
||||
|
||||
@@ -45,6 +45,7 @@ void sdPoll10ms();
|
||||
uint8_t pwrCheck();
|
||||
#define UNEXPECTED_SHUTDOWN() ((mcusr & (1 << WDRF)) || g_eeGeneral.unexpectedShutdown)
|
||||
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
// USB fake driver
|
||||
#define usbPlugged() false
|
||||
|
||||
#endif
|
||||
|
||||
@@ -244,7 +244,6 @@ uint32_t pwrCheck();
|
||||
|
||||
// EEPROM driver
|
||||
void eepromInit();
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
|
||||
// Rotary Encoder driver
|
||||
void rotencInit();
|
||||
|
||||
@@ -229,6 +229,7 @@ extern uint8_t RotEncoder ;
|
||||
void rotencPoll();
|
||||
#endif
|
||||
|
||||
#define EEPROM_MASSSTORAGE() (0)
|
||||
// USB fake driver
|
||||
#define usbPlugged() false
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,7 +172,6 @@ void pwrOff();
|
||||
void usbInit(void);
|
||||
void usbStart(void);
|
||||
bool usbPlugged(void);
|
||||
#define EEPROM_MASSSTORAGE() usbPlugged()
|
||||
|
||||
// EEPROM driver
|
||||
#if !defined(SIMU)
|
||||
|
||||
Reference in New Issue
Block a user