diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-16 07:59:42 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-16 07:59:42 +0100 |
commit | 44358d6a9315634fe65d4a58ae50208e3a9957bf (patch) | |
tree | 28a306ab09e2a0c35a082548cfce04c3774b1332 /src/arch/esp8266 | |
parent | d0400d63dfca33d3839fafc1553357150cd19eca (diff) |
esp8266: Use os_printf where applicable
Diffstat (limited to 'src/arch/esp8266')
-rw-r--r-- | src/arch/esp8266/driver/stdout.cc | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/arch/esp8266/driver/stdout.cc b/src/arch/esp8266/driver/stdout.cc index 2064b38..4471672 100644 --- a/src/arch/esp8266/driver/stdout.cc +++ b/src/arch/esp8266/driver/stdout.cc @@ -21,37 +21,37 @@ StandardOutput & StandardOutput::operator<<(char c) StandardOutput & StandardOutput::operator<<(unsigned short number) { - *this << (unsigned long long)number; + os_printf("%u", number); return *this; } StandardOutput & StandardOutput::operator<<(short number) { - *this << (long long)number; + os_printf("%d", number); return *this; } StandardOutput & StandardOutput::operator<<(unsigned int number) { - *this << (unsigned long long)number; + os_printf("%u", number); return *this; } StandardOutput & StandardOutput::operator<<(int number) { - *this << (long long)number; + os_printf("%d", number); return *this; } StandardOutput & StandardOutput::operator<<(unsigned long number) { - *this << (unsigned long long)number; + os_printf("%lu", number); return *this; } StandardOutput & StandardOutput::operator<<(long number) { - *this << (long long)number; + os_printf("%ld", number); return *this; } @@ -122,10 +122,7 @@ StandardOutput & StandardOutput::operator<<(void *pointer) StandardOutput & StandardOutput::operator<<(const char *text) { - int i = 0; - while (text[i] != '\0') { - put(text[i++]); - } + write(text); return *this; } @@ -227,11 +224,6 @@ StandardOutput & term(StandardOutput & os) return os; } -StandardOutput::StandardOutput() -{ - base = 10; -} - void StandardOutput::setup() { uart_div_modify(0, UART_CLK_FREQ / 115200); |