From 73aee8da54f847341d0fd9718d05ca964654a6dd Mon Sep 17 00:00:00 2001 From: danicampora Date: Wed, 4 Mar 2015 13:51:01 +0100 Subject: cc3200: Merge ExtInt class into Pin class. Also add another method to change the pin's interrupt mode on the fly. --- cc3200/misc/pin_named_pins.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cc3200/misc') diff --git a/cc3200/misc/pin_named_pins.c b/cc3200/misc/pin_named_pins.c index b2a12900e..67f75c330 100644 --- a/cc3200/misc/pin_named_pins.c +++ b/cc3200/misc/pin_named_pins.c @@ -67,3 +67,14 @@ const pin_obj_t *pin_find_pin(const mp_obj_dict_t *named_pins, uint pin_num) { } return NULL; } + +const pin_obj_t *pin_find_pin_by_port_bit (const mp_obj_dict_t *named_pins, uint port, uint bit) { + mp_map_t *named_map = mp_obj_dict_get_map((mp_obj_t)named_pins); + for (uint i = 0; i < named_map->used; i++) { + if ((((pin_obj_t *)named_map->table[i].value)->port == port) && + (((pin_obj_t *)named_map->table[i].value)->bit == bit)) { + return named_map->table[i].value; + } + } + return NULL; +} -- cgit v1.2.3