diff --git a/Tools/AP_Bootloader/support.cpp b/Tools/AP_Bootloader/support.cpp index 79ca46dd91..d8a9c08ab8 100644 --- a/Tools/AP_Bootloader/support.cpp +++ b/Tools/AP_Bootloader/support.cpp @@ -242,12 +242,14 @@ extern "C" { // printf to USB for debugging void uprintf(const char *fmt, ...) { +#if HAL_USE_SERIAL_USB == TRUE char msg[200]; va_list ap; va_start(ap, fmt); uint32_t n = vsnprintf(msg, sizeof(msg), fmt, ap); va_end(ap); chnWriteTimeout(&SDU1, (const uint8_t *)msg, n, MS2ST(100)); +#endif } // generate a pulse sequence forever, for debugging @@ -327,7 +329,7 @@ void lock_bl_port(void) */ void init_uarts(void) { -#ifdef HAL_USE_SERIAL_USB +#if HAL_USE_SERIAL_USB == TRUE sduObjectInit(&SDU1); sduStart(&SDU1, &serusbcfg); @@ -341,7 +343,7 @@ void init_uarts(void) sercfg.speed = BOOTLOADER_BAUDRATE; for (uint8_t i=0; i