aboutsummaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-03-10 18:55:17 +0100
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-03-10 18:55:17 +0100
commitbccfbe4e005ce95693644bf6902885ba902a30f0 (patch)
tree0bedcfbe3b80b457c43722f9776d7be234d86787 /shared-bindings
parentfcd60915e2751a30c74b2f620a94ffd273dce386 (diff)
Fix duty_cycle constructor argument to PWMOut.
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/nativeio/PWMOut.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shared-bindings/nativeio/PWMOut.c b/shared-bindings/nativeio/PWMOut.c
index ff45a22b2..6d5710f8e 100644
--- a/shared-bindings/nativeio/PWMOut.c
+++ b/shared-bindings/nativeio/PWMOut.c
@@ -95,7 +95,7 @@ STATIC mp_obj_t nativeio_pwmout_make_new(const mp_obj_type_t *type, size_t n_arg
mp_map_t kw_args;
mp_map_init_fixed_table(&kw_args, n_kw, args + n_args);
- enum { ARG_duty, ARG_frequency, ARG_variable_frequency };
+ enum { ARG_duty_cycle, ARG_frequency, ARG_variable_frequency };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_duty_cycle, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
{ MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 500} },
@@ -103,11 +103,11 @@ STATIC mp_obj_t nativeio_pwmout_make_new(const mp_obj_type_t *type, size_t n_arg
};
mp_arg_val_t parsed_args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args - 1, args + 1, &kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, parsed_args);
- uint8_t duty = parsed_args[ARG_duty].u_int;
+ uint16_t duty_cycle = parsed_args[ARG_duty_cycle].u_int;
uint32_t frequency = parsed_args[ARG_frequency].u_int;
bool variable_frequency = parsed_args[ARG_variable_frequency].u_int;
- common_hal_nativeio_pwmout_construct(self, pin, duty, frequency, variable_frequency);
+ common_hal_nativeio_pwmout_construct(self, pin, duty_cycle, frequency, variable_frequency);
return MP_OBJ_FROM_PTR(self);
}