raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.26k stars 838 forks source link

Add alarm_pool_remaining_time() #1629

Open TheRaf974 opened 5 months ago

TheRaf974 commented 5 months ago

Add a function that returns the time remaining before triggering for a given pool and alarm id It uses difference between an alarm register and the timerawl register. (see RP2040 datasheet chapter 4.6.3) It also check that the alarm for which we're asking the remaining time is the actual one running on the hardware timer (and not in the alarm pool)

Refer to #1628

kilograham commented 1 month ago

fixes #1628

kilograham commented 1 month ago

will fix this internally as part of redoing the alarm pool implementation; note the return should be 64 bit.