Skip to content

Implement utime module ticks_ms function. #7

Closed
@tdicola

Description

@tdicola

Right now the utime module just has sleep functions, but it would be very useful to add at least a ticks_ms function that returns a monotonically increasing millisecond tick count (at least increasing until it overflows and wraps around). This is handy for loops and such that need to know how much time has elapsed since the previous iteration. The ESP8266 port has a ticks_ms, ticks_us, etc. functions that are a good model to follow.

To implement this we probably want to use the SysTick counter and expose its value with the MicroPython HAL ticks function (currently just implemented to return 0). Poking around the ASF for the M0 I don't see many handy functions for it so might need to just deal with the SysTick registers, etc. directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions