Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SX127x sx12xx_hal TSL2561
Diff: board/board.cpp
- Revision:
- 34:9c8966cd66a2
- Parent:
- 29:ad409c68c0a6
--- a/board/board.cpp Wed Dec 19 13:56:04 2018 -0800 +++ b/board/board.cpp Fri Jul 10 11:12:59 2020 -0700 @@ -24,7 +24,48 @@ */ static uint8_t IrqNestLevel = 0; -RawSerial pc( USBTX, USBRX ); +UnbufferedSerial pc( USBTX, USBRX ); + +void app_printf(const char *fmt, ...) +{ + char n, str[64]; + va_list arg_ptr; + + pc.write("\e[35m", 5); + + va_start(arg_ptr, fmt); + n = vsnprintf(str, sizeof(str), fmt, arg_ptr); + va_end(arg_ptr); + pc.write(str, n); + + pc.write("\e[0m", 4); +} + +void mac_printf(const char *fmt, ...) +{ + char n, str[64]; + va_list arg_ptr; + + pc.write("\e[36m", 5); + + va_start(arg_ptr, fmt); + n = vsnprintf(str, sizeof(str), fmt, arg_ptr); + va_end(arg_ptr); + pc.write(str, n); + + pc.write("\e[0m", 4); +} + +void pc_printf(const char *fmt, ...) +{ + char n, str[64]; + va_list arg_ptr; + + va_start(arg_ptr, fmt); + n = vsnprintf(str, sizeof(str), fmt, arg_ptr); + va_end(arg_ptr); + pc.write(str, n); +} void BoardDisableIrq( void ) {