Skip to content

test_pwm_output_device_alt_values fails with micropython 1.20 #103

Closed
@martinohanlon

Description

@martinohanlon

Describe the bug

test_pwm_output_device_alt_values fails with the latest version of micropython v1.20.0-38-g1b980c9db

Previously micropython PWM.duty_u16 device would return 1 less than the duty factor when "on", if the duty factor was less than the maximum of 65535./

See this comment https://github.com/RaspberryPiFoundation/picozero/blob/master/tests/test_picozero.py#L182

This is no longer the case.

To Reproduce
Steps to reproduce the behaviour:

  1. Update the pico with the latest firmware - https://micropython.org/download/rp2-pico/rp2-pico-latest.uf2
  2. Run tests/test_picozero.py
test_pwm_output_device_alt_values (Testpicozero) ... FAIL
Traceback (most recent call last):
  File "<stdin>", line 598, in <module>
  File "/lib/unittest.py", line 222, in main
  File "/lib/unittest.py", line 160, in run
  File "/lib/unittest.py", line 195, in run_class
  File "<stdin>", line 183, in test_pwm_output_device_alt_values
  File "/lib/unittest.py", line 32, in assertEqual
AssertionError: 10000 vs (expected) 9999

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions