diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/esp8266/driver/stdout.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/arch/esp8266/driver/stdout.cc b/src/arch/esp8266/driver/stdout.cc index 4471672..d8e07a8 100644 --- a/src/arch/esp8266/driver/stdout.cc +++ b/src/arch/esp8266/driver/stdout.cc @@ -9,7 +9,11 @@ void os_printf_plus(const char *s, ...); StandardOutput & StandardOutput::operator<<(unsigned char c) { - put(c); + if (base == 16) { + os_printf("%02x", c); + } else { + os_printf("%d", c); + } return *this; } @@ -33,13 +37,21 @@ StandardOutput & StandardOutput::operator<<(short number) StandardOutput & StandardOutput::operator<<(unsigned int number) { - os_printf("%u", number); + if (base == 16) { + os_printf("%08x", number); + } else { + os_printf("%u", number); + } return *this; } StandardOutput & StandardOutput::operator<<(int number) { - os_printf("%d", number); + if (base == 16) { + os_printf("%08x", number); + } else { + os_printf("%d", number); + } return *this; } |