Compilation fixes

This commit is contained in:
Bertrand Songis
2019-04-25 16:02:34 +02:00
parent 354cd97fd3
commit 5ab678298f
6 changed files with 10 additions and 11 deletions
+5 -5
View File
@@ -292,7 +292,7 @@ void Bluetooth::wakeup(void)
static tmr10ms_t waitEnd = 0;
if (state != BLUETOOTH_STATE_IDLE) {
if (state == BLUETOOTH_INIT) {
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE);
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
char command[32];
char * cur = strAppend(command, BLUETOOTH_COMMAND_NAME);
uint8_t len = ZLEN(g_eeGeneral.bluetoothName);
@@ -316,7 +316,7 @@ void Bluetooth::wakeup(void)
state = BLUETOOTH_STATE_IDLE;
}
else {
bluetoothInit(BLUETOOTH_FACTORY_BAUDRATE);
bluetoothInit(BLUETOOTH_FACTORY_BAUDRATE, true);
writeString("TTM:BPS-115200");
state = BLUETOOTH_WAIT_BAUDRATE_CHANGE;
waitEnd = get_tmr10ms() + 250; // 2.5s
@@ -362,7 +362,7 @@ void Bluetooth::wakeup()
wakeupTime = now + 10; /* 100ms */
}
else if (state == BLUETOOTH_STATE_OFF) {
bluetoothInit(BLUETOOTH_FACTORY_BAUDRATE);
bluetoothInit(BLUETOOTH_FACTORY_BAUDRATE, true);
state = BLUETOOTH_STATE_FACTORY_BAUDRATE_INIT;
}
@@ -372,7 +372,7 @@ void Bluetooth::wakeup()
wakeupTime = now + 10; /* 100ms */
}
else if (state == BLUETOOTH_STATE_BAUDRATE_SENT) {
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE);
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
state = BLUETOOTH_STATE_BAUDRATE_INIT;
readline(false);
wakeupTime = now + 10; /* 100ms */
@@ -528,7 +528,7 @@ void Bluetooth::flashFirmware(const char * filename)
pausePulses();
bluetoothInit(BLUETOOTH_BOOTLOADER_BAUDRATE);
bluetoothInit(BLUETOOTH_BOOTLOADER_BAUDRATE, true);
bluetoothDisable(); /* go to bootloader mode */
drawProgressScreen(getBasename(filename), "Bluetooth reset...", 0, 0);
+1 -1
View File
@@ -1170,7 +1170,7 @@ int cliBlueTooth(const char ** argv)
}
else if (toInt(argv, 1, &baudrate) > 0) {
if (baudrate > 0) {
bluetoothInit(baudrate);
bluetoothInit(baudrate, true);
char * line = bluetooth.readline();
serialPrint("<BT %s", line);
}
+1 -1
View File
@@ -215,7 +215,7 @@ void boardInit()
hapticInit();
#if defined(BLUETOOTH)
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE);
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
#endif
#if defined(INTERNAL_GPS)
+1 -2
View File
@@ -612,7 +612,7 @@ void serial2Stop(void);
#define BLUETOOTH_BOOTLOADER_BAUDRATE 230400
#define BLUETOOTH_FACTORY_BAUDRATE 57600
#define BLUETOOTH_DEFAULT_BAUDRATE 115200
void bluetoothInit(uint32_t baudrate, bool enable = true);
void bluetoothInit(uint32_t baudrate, bool enable);
void bluetoothWriteWakeup(void);
uint8_t bluetoothIsWriting(void);
void bluetoothDisable(void);
@@ -627,5 +627,4 @@ extern DMAFifo<512> telemetryFifo;
extern DMAFifo<32> serial2RxFifo;
#endif
#endif // _BOARD_HORUS_H_
+1 -1
View File
@@ -167,7 +167,7 @@ void boardInit()
BT_RCC_APB2Periph, ENABLE);
#if defined(BLUETOOTH)
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE);
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
#endif
#if !defined(PCBX9E)
+1 -1
View File
@@ -726,7 +726,7 @@ void serial2Stop(void);
#else
#define BLUETOOTH_FACTORY_BAUDRATE 57600
#endif
void bluetoothInit(uint32_t baudrate, bool enable = true);
void bluetoothInit(uint32_t baudrate, bool enable);
void bluetoothWriteWakeup(void);
uint8_t bluetoothIsWriting(void);
void bluetoothDisable(void);