From ccbb5e84f980e252f7380d96fcc5c417a8a64523 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 3 Nov 2016 15:50:59 -0700 Subject: This introduces an alternative hardware API called nativeio structured around different functions that are typically accelerated by native hardware. Its not meant to reflect the structure of the hardware. Docs are here: http://tannewt-micropython.readthedocs.io/en/microcontroller/ It differs from upstream's machine in the following ways: * Python API is identical across ports due to code structure. (Lives in shared-bindings) * Focuses on abstracting common functionality (AnalogIn) and not representing structure (ADC). * Documentation lives with code making it easy to ensure they match. * Pin is split into references (board.D13 and microcontroller.pin.PA17) and functionality (DigitalInOut). * All nativeio classes claim underlying hardware resources when inited on construction, support Context Managers (aka with statements) and have deinit methods which release the claimed hardware. * All constructors take pin references rather than peripheral ids. Its up to the implementation to find hardware or throw and exception. --- extmod/modwebrepl.c | 2 +- extmod/uos_dupterm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'extmod') diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c index 8e0580966..571acabfe 100644 --- a/extmod/modwebrepl.c +++ b/extmod/modwebrepl.c @@ -40,7 +40,7 @@ #include "extmod/modwebsocket.h" #include "genhdr/mpversion.h" -#if MICROPY_PY_WEBREPL +#ifdef MICROPY_PY_WEBREPL #if 0 // print debugging info #define DEBUG_printf DEBUG_printf diff --git a/extmod/uos_dupterm.c b/extmod/uos_dupterm.c index d888099df..926a2bf0f 100644 --- a/extmod/uos_dupterm.c +++ b/extmod/uos_dupterm.c @@ -34,7 +34,7 @@ #include "py/objarray.h" #include "py/stream.h" -#if MICROPY_PY_OS_DUPTERM +#ifdef MICROPY_PY_OS_DUPTERM void mp_uos_deactivate(const char *msg, mp_obj_t exc) { mp_obj_t term = MP_STATE_PORT(term_obj); -- cgit v1.2.3