HAL_ChibiOS: modify hal can drivers for use by AP_Periph

This commit is contained in:
Siddharth Purohit authored and Peter Barker committed 2020-09-24 12:32:19 +10:00
1 parent c7d69e4d13
commit 36ffcdae30
8 files changed
+161 -73

No files matched your search

+7 -1
View File
@@ -34,7 +34,9 @@
#include "UARTDriver.h"
#endif
#ifndef HAL_BOOTLOADER_BUILD
extern const AP_HAL::HAL& hal;
#endif
int __wrap_snprintf(char *str, size_t size, const char *fmt, ...)
{
@@ -42,7 +44,11 @@ int __wrap_snprintf(char *str, size_t size, const char *fmt, ...)
int done;
va_start (arg, fmt);
#ifdef HAL_BOOTLOADER_BUILD
done = chvsnprintf(str, size, fmt, arg);
#else
done = hal.util->vsnprintf(str, size, fmt, arg);
#endif
va_end (arg);
return done;
@@ -85,7 +91,7 @@ int __wrap_vprintf(const char *fmt, va_list arg)
{
#ifdef HAL_STDOUT_SERIAL
return chvprintf((BaseSequentialStream*)&HAL_STDOUT_SERIAL, fmt, arg);
#elif HAL_USE_SERIAL_USB == TRUE
#elif HAL_USE_SERIAL_USB == TRUE && !defined(HAL_BOOTLOADER_BUILD)
usb_initialise();
return chvprintf((BaseSequentialStream*)&SDU1, fmt, arg);
#else