Skip to content

Commit 73aee8d

Browse files
committed
cc3200: Merge ExtInt class into Pin class.
Also add another method to change the pin's interrupt mode on the fly.
1 parent 26cbc91 commit 73aee8d

File tree

12 files changed

+306
-483
lines changed

12 files changed

+306
-483
lines changed

cc3200/application.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ APP_MODS_SRC_C = $(addprefix mods/,\
8989
modutime.c \
9090
modwlan.c \
9191
pybadc.c \
92-
pybextint.c \
9392
pybi2c.c \
9493
pybpin.c \
9594
pybrtc.c \

cc3200/boards/cc3200_prefix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
{ \
4444
{ &pin_type }, \
4545
.name = MP_QSTR_ ## p_pin_name, \
46+
.callback = NULL, \
4647
.port = PORT_A ## p_port, \
4748
.type = PIN_TYPE_STD, \
4849
.bit = (p_bit), \

cc3200/misc/pin_named_pins.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,14 @@ const pin_obj_t *pin_find_pin(const mp_obj_dict_t *named_pins, uint pin_num) {
6767
}
6868
return NULL;
6969
}
70+
71+
const pin_obj_t *pin_find_pin_by_port_bit (const mp_obj_dict_t *named_pins, uint port, uint bit) {
72+
mp_map_t *named_map = mp_obj_dict_get_map((mp_obj_t)named_pins);
73+
for (uint i = 0; i < named_map->used; i++) {
74+
if ((((pin_obj_t *)named_map->table[i].value)->port == port) &&
75+
(((pin_obj_t *)named_map->table[i].value)->bit == bit)) {
76+
return named_map->table[i].value;
77+
}
78+
}
79+
return NULL;
80+
}

cc3200/mods/modpyb.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
#include "task.h"
5555
#include "mpexception.h"
5656
#include "random.h"
57-
#include "pybextint.h"
5857
#include "pybadc.h"
5958
#include "pybi2c.h"
6059
#include "pybsd.h"
@@ -312,7 +311,6 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
312311
#endif
313312

314313
{ MP_OBJ_NEW_QSTR(MP_QSTR_Pin), (mp_obj_t)&pin_type },
315-
{ MP_OBJ_NEW_QSTR(MP_QSTR_ExtInt), (mp_obj_t)&extint_type },
316314
{ MP_OBJ_NEW_QSTR(MP_QSTR_ADC), (mp_obj_t)&pyb_adc_type },
317315
{ MP_OBJ_NEW_QSTR(MP_QSTR_I2C), (mp_obj_t)&pyb_i2c_type },
318316
{ MP_OBJ_NEW_QSTR(MP_QSTR_UART), (mp_obj_t)&pyb_uart_type },

0 commit comments

Comments
 (0)