Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • F firmware
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
  • Issues 74
    • Issues 74
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 29
    • Merge requests 29
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • card10card10
  • firmware
  • Merge requests
  • !324

Implement proper delays for Pycardium

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Rahix requested to merge rahix/proper-sleep into master Oct 03, 2019
  • Overview 15
  • Commits 1
  • Pipelines 9
  • Changes 1

Rewrite the delay implementation to be more accurate and properly handle incoming MicroPython interrupts (See issue #177 (closed)).

For this, the delay is split into two functions:

  • systick_delay_precise(): Delay with microsecond accuracy for delays less than 1 ms.
  • systick_delay_sleep(): Sleep for a potentially very long time, using WFI to put the CPU to sleep. Whenever the CPU wakes up, this function will poll the MicroPython scheduler so it can execute pending interrupts.

Ontop, this implementation allows for a future, fast, tick-based monotonic time implementation (e.g. mp_hal_ticks_ms).


Fixes #177 (closed).

Cc: @Woazboat

Edited Nov 11, 2019 by Rahix
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: rahix/proper-sleep