From a2d5d84ecca175fbfbf42e892d6376efd08758eb Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 22 Apr 2016 10:04:12 +0100 Subject: 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. --- esp8266/modpyb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'esp8266/modpyb.h') diff --git a/esp8266/modpyb.h b/esp8266/modpyb.h index 8d27ebed7..c1a0413f0 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); -- cgit v1.2.3