summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/esp_mphal.c
diff options
context:
space:
mode:
Diffstat (limited to 'esp8266/esp_mphal.c')
-rw-r--r--esp8266/esp_mphal.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c
index 821866f689..53a1700277 100644
--- a/esp8266/esp_mphal.c
+++ b/esp8266/esp_mphal.c
@@ -49,23 +49,30 @@ void mp_hal_udelay(uint32_t us) {
ets_delay_us(us);
}
-int mp_hal_uart0_rx_chr(void) {
- return uart0_rx();
+int mp_hal_stdin_rx_chr(void) {
+ for (;;) {
+ int c = uart0_rx();
+ if (c != -1) {
+ return c;
+ }
+ mp_hal_udelay(1);
+ mp_hal_feed_watchdog();
+ }
}
-void mp_hal_uart0_write_str(const char *str) {
+void mp_hal_stdout_tx_str(const char *str) {
while (*str) {
uart_tx_one_char(UART0, *str++);
}
}
-void mp_hal_uart0_write_strn(const char *str, uint32_t len) {
+void mp_hal_stdout_tx_strn(const char *str, uint32_t len) {
while (len--) {
uart_tx_one_char(UART0, *str++);
}
}
-void mp_hal_uart0_write_strn_cooked(const char *str, uint32_t len) {
+void mp_hal_stdout_tx_strn_cooked(const char *str, uint32_t len) {
while (len--) {
if (*str == '\n') {
uart_tx_one_char(UART0, '\r');