From dcf84169ae75b11c1656d45dbc6c626d93da6a10 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 8 Dec 2017 15:07:52 +0100 Subject: Add output support (broken on esp8266) --- src/arch/esp8266/driver/stdout.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/arch/esp8266/driver/stdout.cc (limited to 'src/arch/esp8266/driver') diff --git a/src/arch/esp8266/driver/stdout.cc b/src/arch/esp8266/driver/stdout.cc new file mode 100644 index 0000000..b35275b --- /dev/null +++ b/src/arch/esp8266/driver/stdout.cc @@ -0,0 +1,25 @@ +#include "driver/stdout.h" +extern "C" { +#include "osapi.h" +#include "user_interface.h" +#include "gpio.h" +void uart_div_modify(uint8_t uart_no, uint32 DivLatchValue); +void os_printf_plus(const char *s, ...); +} + +void StandardOutput::setup() +{ + uart_div_modify(0, UART_CLK_FREQ / 115200); +} + +void StandardOutput::put(char c) +{ + os_printf("%c", c); +} + +void StandardOutput::write(const char *s) +{ + os_printf("%s", s); +} + +StandardOutput kout; -- cgit v1.2.3