Skip to content

drivers: Replace deprecated utime imports with time. #57

@nedseb

Description

@nedseb

Problem

Some drivers import from utime instead of time. The utime module is deprecated since MicroPython 1.19+ and time is the standard replacement. Additionally, some drivers use time.sleep() with float seconds instead of the MicroPython-idiomatic sleep_ms() with integer milliseconds.

Already fixed

To review

  • wsen-pads (lib/wsen-pads/wsen_pads/device.py) — uses from utime import sleep_ms, ticks_ms, ticks_diff
  • apds9960 (lib/apds9960/apds9960/device.py) — uses from time import sleep then sleep(0.3) — should use sleep_ms(300)

Expected behavior

All drivers must use:

  • from time import sleep_ms (not from utime import)
  • sleep_ms(N) with integer milliseconds (not sleep(0.N) with float seconds)

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorNettoyage/harmonisation sans changement fonctionnelreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions