From 640d00ea9d17c2243dd4b9c89223f4ab0c811c0e Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Tue, 9 Jun 2015 14:10:37 +0200 Subject: [PATCH] cc3200: Change MP_OBJ_NULL for mp_const_none in params default value. --- cc3200/mods/modwlan.c | 8 ++++---- cc3200/mods/pybi2c.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cc3200/mods/modwlan.c b/cc3200/mods/modwlan.c index 6aecaecc66..664bbf0543 100644 --- a/cc3200/mods/modwlan.c +++ b/cc3200/mods/modwlan.c @@ -744,8 +744,8 @@ STATIC mp_obj_t wlan_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ STATIC const mp_arg_t allowed_args[] = { { MP_QSTR_ssid, MP_ARG_REQUIRED | MP_ARG_OBJ, }, { MP_QSTR_security, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = SL_SEC_TYPE_OPEN} }, - { MP_QSTR_key, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_bssid, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_key, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_bssid, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = MODWLAN_TIMEOUT_MS} }, }; @@ -770,7 +770,7 @@ STATIC mp_obj_t wlan_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ const char *key = NULL; mp_buffer_info_t wepkey; mp_obj_t key_o = args[2].u_obj; - if (key_o != MP_OBJ_NULL) { + if (key_o != mp_const_none) { // wep key must be given as raw bytes if (sec == SL_SEC_TYPE_WEP) { mp_get_buffer_raise(key_o, &wepkey, MP_BUFFER_READ); @@ -783,7 +783,7 @@ STATIC mp_obj_t wlan_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_ // get bssid const char *bssid = NULL; - if (args[3].u_obj != MP_OBJ_NULL) { + if (args[3].u_obj != mp_const_none) { bssid = mp_obj_str_get_str(args[3].u_obj); } diff --git a/cc3200/mods/pybi2c.c b/cc3200/mods/pybi2c.c index 8d0e5f9629..2dac70098e 100644 --- a/cc3200/mods/pybi2c.c +++ b/cc3200/mods/pybi2c.c @@ -378,7 +378,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_i2c_scan_obj, pyb_i2c_scan); /// - `addr` is the address to send to (only required in master mode) /// Return value: `None`. STATIC const mp_arg_t pyb_i2c_send_args[] = { - { MP_QSTR_send, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_send, MP_ARG_REQUIRED | MP_ARG_OBJ, }, { MP_QSTR_addr, MP_ARG_INT, {.u_int = 0} }, }; #define PYB_I2C_SEND_NUM_ARGS MP_ARRAY_SIZE(pyb_i2c_send_args) @@ -413,7 +413,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_i2c_send_obj, 1, pyb_i2c_send); /// Return value: if `recv` is an integer then a new buffer of the bytes received, /// otherwise the same buffer that was passed in to `recv`. STATIC const mp_arg_t pyb_i2c_recv_args[] = { - { MP_QSTR_recv, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_recv, MP_ARG_REQUIRED | MP_ARG_OBJ, }, { MP_QSTR_addr, MP_ARG_INT, {.u_int = 0} }, }; #define PYB_I2C_RECV_NUM_ARGS MP_ARRAY_SIZE(pyb_i2c_recv_args) @@ -454,7 +454,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_i2c_recv_obj, 1, pyb_i2c_recv); /// Returns the read data. /// This is only valid in master mode. STATIC const mp_arg_t pyb_i2c_mem_read_args[] = { - { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ, }, { MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_memaddr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_addr_size, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} },