summaryrefslogtreecommitdiff
path: root/extmod/modbluetooth.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-10-15 17:29:27 +1100
committerDamien George <damien.p.george@gmail.com>2019-10-15 17:29:27 +1100
commit8f7f67123680947d7f7a38f8a2aff63c0ddd0338 (patch)
tree11a295358fc0706df2a6b44c276106db60878bbd /extmod/modbluetooth.c
parent36502bdfdcd63b2bc87027380dc63098221e8b04 (diff)
extmod/modbluetooth: In gap_advertise only accept None to stop adv.
To match the docs, and interval=0 may be used in the future to indicate something else.
Diffstat (limited to 'extmod/modbluetooth.c')
-rw-r--r--extmod/modbluetooth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c
index 640449925..3c00d5c1b 100644
--- a/extmod/modbluetooth.c
+++ b/extmod/modbluetooth.c
@@ -313,12 +313,12 @@ STATIC mp_obj_t bluetooth_ble_gap_advertise(size_t n_args, const mp_obj_t *pos_a
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
- mp_int_t interval_us;
- if (args[ARG_interval_us].u_obj == mp_const_none || (interval_us = mp_obj_get_int(args[ARG_interval_us].u_obj)) == 0) {
+ if (args[ARG_interval_us].u_obj == mp_const_none) {
mp_bluetooth_gap_advertise_stop();
return mp_const_none;
}
+ mp_int_t interval_us = mp_obj_get_int(args[ARG_interval_us].u_obj);
bool connectable = mp_obj_is_true(args[ARG_connectable].u_obj);
mp_buffer_info_t adv_bufinfo = {0};