Browse Source

AP_Bootloader: fixed build with no uarts

master
Andrew Tridgell 7 years ago
parent
commit
0546ea69d1
  1. 4
      Tools/AP_Bootloader/AP_Bootloader.cpp
  2. 10
      Tools/AP_Bootloader/support.cpp

4
Tools/AP_Bootloader/AP_Bootloader.cpp

@ -35,10 +35,6 @@ extern "C" { @@ -35,10 +35,6 @@ extern "C" {
struct boardinfo board_info;
#ifndef BOOTLOADER_BAUDRATE
#define BOOTLOADER_BAUDRATE 115200
#endif
int main(void)
{
init_uarts();

10
Tools/AP_Bootloader/support.cpp

@ -14,10 +14,16 @@ @@ -14,10 +14,16 @@
#include "mcu_f7.h"
static BaseChannel *uarts[] = { BOOTLOADER_DEV_LIST };
#if HAL_USE_SERIAL == TRUE
static SerialConfig sercfg;
#endif
static int8_t locked_uart = -1;
static uint8_t last_uart;
#ifndef BOOTLOADER_BAUDRATE
#define BOOTLOADER_BAUDRATE 115200
#endif
int16_t cin(unsigned timeout_ms)
{
uint8_t b = 0;
@ -328,6 +334,7 @@ void init_uarts(void) @@ -328,6 +334,7 @@ void init_uarts(void)
usbConnectBus(serusbcfg.usbp);
#endif
#if HAL_USE_SERIAL == TRUE
sercfg.speed = BOOTLOADER_BAUDRATE;
for (uint8_t i=0; i<ARRAY_SIZE_SIMPLE(uarts); i++) {
@ -338,6 +345,7 @@ void init_uarts(void) @@ -338,6 +345,7 @@ void init_uarts(void)
#endif
sdStart((SerialDriver *)uarts[i], &sercfg);
}
#endif
}
@ -352,8 +360,10 @@ void port_setbaud(uint32_t baudrate) @@ -352,8 +360,10 @@ void port_setbaud(uint32_t baudrate)
return;
}
#endif
#if HAL_USE_SERIAL == TRUE
memset(&sercfg, 0, sizeof(sercfg));
sercfg.speed = baudrate;
sdStart((SerialDriver *)uarts[last_uart], &sercfg);
#endif
}

Loading…
Cancel
Save