summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-06-06 16:23:06 -0700
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-06-06 16:23:06 -0700
commitc8dc09128831a9376a1e5322411241548b4ec8d5 (patch)
tree37104da59daaaea06e59a09e6f68cd7c97e23668
parentb5f50fadf99319ea25d3f4ee5e7e7437e149d28e (diff)
shared-bindings: Fix duty_cycle parameter description and error message.
-rw-r--r--shared-bindings/pulseio/PWMOut.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c
index 73f3bfd3e..850033502 100644
--- a/shared-bindings/pulseio/PWMOut.c
+++ b/shared-bindings/pulseio/PWMOut.c
@@ -51,7 +51,7 @@
//| fixed outputs first.
//|
//| :param ~microcontroller.Pin pin: The pin to output to
-//| :param int duty: The fraction of each pulse which is high. 16-bit
+//| :param int duty_cycle: The fraction of each pulse which is high. 16-bit
//| :param int frequency: The target frequency in Hertz (32-bit)
//| :param bool variable_frequency: True if the frequency will change over time
//|
@@ -155,7 +155,7 @@ STATIC mp_obj_t pulseio_pwmout_obj_set_duty_cycle(mp_obj_t self_in, mp_obj_t dut
pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in);
mp_int_t duty = mp_obj_get_int(duty_cycle);
if (duty < 0 || duty > 0xffff) {
- mp_raise_ValueError("PWM duty must be between 0 and 65536 (16 bit resolution)");
+ mp_raise_ValueError("PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)");
}
common_hal_pulseio_pwmout_set_duty_cycle(self, duty);
return mp_const_none;