aboutsummaryrefslogtreecommitdiff
path: root/extmod/machine_i2c.c
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@mailme.dk>2020-10-03 11:23:12 +0200
committerEmil Renner Berthing <esmil@mailme.dk>2020-10-22 11:47:36 +0200
commit9aa58cf8bac353297ff5e7b4f3331e5618046095 (patch)
tree0f36014f1e370a0797bc23da1c9c9ae4c5f77f1a /extmod/machine_i2c.c
parentfdd6fa389ed68a5d0761f7cb71c94db5e927d741 (diff)
py, extmod: Add explicit initializers for default values.
When compiling with -Wextra which includes -Wmissing-field-initializers GCC will warn that the defval field of mp_arg_val_t is not initialized. This is just a warning as it is defined to be zero initialized, but since it is a union it makes sense to be explicit about which member we're going to use, so add the explicit initializers and get rid of the warning.
Diffstat (limited to 'extmod/machine_i2c.c')
-rw-r--r--extmod/machine_i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/machine_i2c.c b/extmod/machine_i2c.c
index 9203f16f6..12c9abbcb 100644
--- a/extmod/machine_i2c.c
+++ b/extmod/machine_i2c.c
@@ -311,8 +311,8 @@ STATIC void mp_machine_soft_i2c_print(const mp_print_t *print, mp_obj_t self_in,
STATIC void machine_i2c_obj_init_helper(machine_i2c_obj_t *self, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_scl, ARG_sda, ARG_freq, ARG_timeout };
static const mp_arg_t allowed_args[] = {
- { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ },
- { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ },
+ { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
+ { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
{ MP_QSTR_freq, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 400000} },
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 255} },
};