diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-16 08:04:06 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-16 08:04:06 +0100 |
commit | 790799a3fa2692bfd3f3f1bac927bb0ef016a096 (patch) | |
tree | 5e4466bc17d469fd1082e2b1bfb003e76dab5601 /src/arch/esp8266/driver | |
parent | 44358d6a9315634fe65d4a58ae50208e3a9957bf (diff) |
esp8266 stdout: partialle respect base, output unsigned char as number
Diffstat (limited to 'src/arch/esp8266/driver')
-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; } |