summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/esp_mphal.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-03-30 18:50:38 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-03-30 18:50:38 +0300
commit61fa7c81527016be164321c442fe5317daa260ee (patch)
tree27a71b6a2fa5b81b8e245ae64e5408f30c0e9095 /esp8266/esp_mphal.h
parent2e75a17bab9a3f3379546659e557f026ef70cabe (diff)
downloadmicropython-61fa7c81527016be164321c442fe5317daa260ee.tar.gz
micropython-61fa7c81527016be164321c442fe5317daa260ee.zip
esp8266: Switch back to accumulating input data via ring buffer.
But now it's generic ring buffer implemented via ringbuf.h, and is intended for any type of input, including dupterm's, not just UART. The general process work like this: an interrupt-driven input source puts data into input_buf, and then signals new data available via call to mp_hal_signal_input().
Diffstat (limited to 'esp8266/esp_mphal.h')
-rw-r--r--esp8266/esp_mphal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/esp8266/esp_mphal.h b/esp8266/esp_mphal.h
index 9a08f5a14d..bedf80b19f 100644
--- a/esp8266/esp_mphal.h
+++ b/esp8266/esp_mphal.h
@@ -27,10 +27,16 @@
#ifndef _INCLUDED_MPHAL_H_
#define _INCLUDED_MPHAL_H_
+#include "py/ringbuf.h"
+
struct _mp_print_t;
// Structure for UART-only output via mp_printf()
extern const struct _mp_print_t mp_debug_print;
+extern ringbuf_t input_buf;
+// Call this after putting data to input_buf
+void mp_hal_signal_input(void);
+
void mp_hal_init(void);
void mp_hal_rtc_init(void);
void mp_hal_feed_watchdog(void);