diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-18 22:38:09 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-18 22:38:09 +0100 |
commit | c66d86c5ce068e860ceb550ad75bf4da5211276b (patch) | |
tree | 2292f0d3cba5886550a7d989aae926664319ae62 /stmhal/usrsw.c | |
parent | 738bdeb73a6ef802ed0c39fb88a733a1ad04d9a1 (diff) | |
download | micropython-c66d86c5ce068e860ceb550ad75bf4da5211276b.tar.gz micropython-c66d86c5ce068e860ceb550ad75bf4da5211276b.zip |
stmhal: Big cleanup; merge gpio into Pin; make names consistent.
This is an attempt to clean up the Micro Python API on the pyboard.
Gpio functionality is now in the Pin object, which seems more natural.
Constants for MODE and PULL are now in pyb.Pin. Names of some
classes have been adjusted to conform to CamelCase. Other
miscellaneous changes and clean up here and there.
Diffstat (limited to 'stmhal/usrsw.c')
-rw-r--r-- | stmhal/usrsw.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c index 0ab407cd96..6e73cf69b4 100644 --- a/stmhal/usrsw.c +++ b/stmhal/usrsw.c @@ -8,7 +8,7 @@ #include "runtime.h" #include "usrsw.h" -#include "exti.h" +#include "extint.h" #include "gpio.h" #include "pin.h" #include "genhdr/pins.h" @@ -70,12 +70,11 @@ static mp_obj_t pyb_switch(uint n_args, mp_obj_t *args) { // Init the EXTI each time this function is called, since the EXTI // may have been disabled by an exception in the interrupt, or the // user disabling the line explicitly. - exti_register((mp_obj_t)&MICROPY_HW_USRSW_PIN, - MP_OBJ_NEW_SMALL_INT(MICROPY_HW_USRSW_EXTI_MODE), - MP_OBJ_NEW_SMALL_INT(MICROPY_HW_USRSW_PULL), - switch_user_callback_obj == mp_const_none ? mp_const_none : (mp_obj_t)&switch_callback_obj, - true, - NULL); + extint_register((mp_obj_t)&MICROPY_HW_USRSW_PIN, + MP_OBJ_NEW_SMALL_INT(MICROPY_HW_USRSW_EXTI_MODE), + MP_OBJ_NEW_SMALL_INT(MICROPY_HW_USRSW_PULL), + switch_user_callback_obj == mp_const_none ? mp_const_none : (mp_obj_t)&switch_callback_obj, + true, NULL); return mp_const_none; } } |