Browse Source

cc3200: Re-name 'intmode' to 'mode' in the callback API.

pull/1266/merge
Daniel Campora 10 years ago
parent
commit
c27dc38e85
  1. 2
      cc3200/misc/mpcallback.c
  2. 6
      cc3200/mods/pybpin.c
  3. 2
      cc3200/qstrdefsport.h

2
cc3200/misc/mpcallback.c

@ -41,7 +41,7 @@
DEFINE PUBLIC DATA
******************************************************************************/
const mp_arg_t mpcallback_init_args[] = {
{ MP_QSTR_intmode, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
{ MP_QSTR_mode, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
{ MP_QSTR_handler, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
{ MP_QSTR_priority, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
{ MP_QSTR_value, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },

6
cc3200/mods/pybpin.c

@ -72,7 +72,7 @@
/// print(pin.get_config().name)
///
/// extint = pyb.Pin('GPIO10', 0, pyb.Pin.INT_RISING, pyb.GPIO.STD_PD, pyb.S2MA)
/// extint.callback (intmode=pyb.Pin.INT_RISING, handler=pincb)
/// extint.callback (mode=pyb.Pin.INT_RISING, handler=pincb)
/// # the callback can be triggered manually
/// extint.callback()()
/// # to disable the callback
@ -543,9 +543,9 @@ STATIC mp_obj_t pin_get_config(mp_obj_t self_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pin_get_config_obj, pin_get_config);
/// \method callback(method, intmode, priority, pwrmode)
/// \method callback(method, mode, priority, pwrmode)
/// Creates a callback object associated to a pin
/// min num of arguments is 1 (intmode)
/// min num of arguments is 1 (mode)
STATIC mp_obj_t pin_callback (mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_arg_val_t args[mpcallback_INIT_NUM_ARGS];
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, mpcallback_INIT_NUM_ARGS, mpcallback_init_args, args);

2
cc3200/qstrdefsport.h

@ -287,7 +287,7 @@ Q(enable)
Q(disable)
Q(callback)
Q(handler)
Q(intmode)
Q(mode)
Q(value)
Q(priority)
Q(wakes)

Loading…
Cancel
Save