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/modpybpin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'esp8266/modpybpin.c') diff --git a/esp8266/modpybpin.c b/esp8266/modpybpin.c index 2049d4bf34..a65911cbd1 100644 --- a/esp8266/modpybpin.c +++ b/esp8266/modpybpin.c @@ -59,7 +59,7 @@ typedef struct _pin_irq_obj_t { uint16_t phys_port; } pin_irq_obj_t; -STATIC const pyb_pin_obj_t pyb_pin_obj[16 + 1] = { +const pyb_pin_obj_t pyb_pin_obj[16 + 1] = { {{&pyb_pin_type}, 0, FUNC_GPIO0, PERIPHS_IO_MUX_GPIO0_U}, {{&pyb_pin_type}, 1, FUNC_GPIO1, PERIPHS_IO_MUX_U0TXD_U}, {{&pyb_pin_type}, 2, FUNC_GPIO2, PERIPHS_IO_MUX_GPIO2_U}, -- cgit v1.2.3