blackboxPrintf - return number of characters written

change fmt to `const char*`
This commit is contained in:
Petr Ledvina 2015-03-14 17:52:15 +01:00
parent c90231f35c
commit 8d2dc82f4b
2 changed files with 4 additions and 3 deletions

View File

@ -91,12 +91,13 @@ static void _putc(void *p, char c)
} }
//printf() to the blackbox serial port with no blocking shenanigans (so it's caller's responsibility to not write too fast!) //printf() to the blackbox serial port with no blocking shenanigans (so it's caller's responsibility to not write too fast!)
void blackboxPrintf(char *fmt, ...) int blackboxPrintf(const char *fmt, ...)
{ {
va_list va; va_list va;
va_start(va, fmt); va_start(va, fmt);
tfp_format(NULL, _putc, fmt, va); int written = tfp_format(NULL, _putc, fmt, va);
va_end(va); va_end(va);
return written;
} }
// Print the null-terminated string 's' to the serial port and return the number of bytes written // Print the null-terminated string 's' to the serial port and return the number of bytes written

View File

@ -36,7 +36,7 @@ uint8_t blackboxWriteChunkSize;
void blackboxWrite(uint8_t value); void blackboxWrite(uint8_t value);
void blackboxPrintf(char *fmt, ...); int blackboxPrintf(const char *fmt, ...);
int blackboxPrint(const char *s); int blackboxPrint(const char *s);
void blackboxWriteUnsignedVB(uint32_t value); void blackboxWriteUnsignedVB(uint32_t value);