AP_Bootloader: fixed uprintf() build

This commit is contained in:
Andrew Tridgell 2019-10-20 07:29:26 +11:00
parent a78ba1d527
commit 13f289d3f0
1 changed files with 4 additions and 1 deletions

View File

@ -274,7 +274,10 @@ void uprintf(const char *fmt, ...)
va_start(ap, fmt); va_start(ap, fmt);
uint32_t n = vsnprintf(umsg, sizeof(umsg), fmt, ap); uint32_t n = vsnprintf(umsg, sizeof(umsg), fmt, ap);
va_end(ap); va_end(ap);
chnWriteTimeout(&BOOTLOADER_DEBUG, (const uint8_t *)umsg, MIN(n,sizeof(umsg)), chTimeMS2I(100)); if (n > sizeof(umsg)) {
n = sizeof(umsg);
}
chnWriteTimeout(&BOOTLOADER_DEBUG, (const uint8_t *)umsg, n, chTimeMS2I(100));
#endif #endif
} }