summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modpyb.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-04-22 10:04:12 +0100
committerDamien George <damien.p.george@gmail.com>2016-04-22 10:04:12 +0100
commita2d5d84ecca175fbfbf42e892d6376efd08758eb (patch)
tree5d382b3ba3bf0c489f90577e3401f4a701b532da /esp8266/modpyb.h
parent624738ca64c71c8f2cccced3fb5d2380bb4ae56b (diff)
downloadmicropython-a2d5d84ecca175fbfbf42e892d6376efd08758eb.tar.gz
micropython-a2d5d84ecca175fbfbf42e892d6376efd08758eb.zip
esp8266: Convert mp_hal_pin_obj_t from pin ptr to simple integer.
Most pin I/O can be done just knowing the pin number as a simple integer, and it's more efficient this way (code size, speed) because it doesn't require a memory lookup to get the pin id from the pin object. If the full pin object is needed then it can be easily looked up in the pin table.
Diffstat (limited to 'esp8266/modpyb.h')
-rw-r--r--esp8266/modpyb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/esp8266/modpyb.h b/esp8266/modpyb.h
index 8d27ebed72..c1a0413f04 100644
--- a/esp8266/modpyb.h
+++ b/esp8266/modpyb.h
@@ -18,6 +18,8 @@ typedef struct _pyb_pin_obj_t {
uint32_t periph;
} pyb_pin_obj_t;
+const pyb_pin_obj_t pyb_pin_obj[16 + 1];
+
void pin_init0(void);
void pin_intr_handler_iram(void *arg);
void pin_intr_handler(uint32_t);