Skip to content

Commit bccfbe4

Browse files
committed
Fix duty_cycle constructor argument to PWMOut.
1 parent fcd6091 commit bccfbe4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shared-bindings/nativeio/PWMOut.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,19 @@ STATIC mp_obj_t nativeio_pwmout_make_new(const mp_obj_type_t *type, size_t n_arg
9595

9696
mp_map_t kw_args;
9797
mp_map_init_fixed_table(&kw_args, n_kw, args + n_args);
98-
enum { ARG_duty, ARG_frequency, ARG_variable_frequency };
98+
enum { ARG_duty_cycle, ARG_frequency, ARG_variable_frequency };
9999
static const mp_arg_t allowed_args[] = {
100100
{ MP_QSTR_duty_cycle, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
101101
{ MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 500} },
102102
{ MP_QSTR_variable_frequency, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
103103
};
104104
mp_arg_val_t parsed_args[MP_ARRAY_SIZE(allowed_args)];
105105
mp_arg_parse_all(n_args - 1, args + 1, &kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, parsed_args);
106-
uint8_t duty = parsed_args[ARG_duty].u_int;
106+
uint16_t duty_cycle = parsed_args[ARG_duty_cycle].u_int;
107107
uint32_t frequency = parsed_args[ARG_frequency].u_int;
108108
bool variable_frequency = parsed_args[ARG_variable_frequency].u_int;
109109

110-
common_hal_nativeio_pwmout_construct(self, pin, duty, frequency, variable_frequency);
110+
common_hal_nativeio_pwmout_construct(self, pin, duty_cycle, frequency, variable_frequency);
111111

112112
return MP_OBJ_FROM_PTR(self);
113113
}

0 commit comments

Comments
 (0)