Skip to content

Commit 07db5c0

Browse files
committed
Add synchronization delay section in lp ticker
Add a section with information about low power ticker synchronization and using LOWPOWERTIMER_DELAY_TICKS to address this problem.
1 parent cf2acf3 commit 07db5c0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/reference/contributing/target/lp_ticker.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ Be careful around these common trouble areas when implementing this API:
3636
- The ticker keeps counting when it rolls over
3737
- The ticker interrupt fires when the compare value is set to 0 and and overflow occurs
3838

39+
#### Handling synchronization delay
40+
41+
Some low power tickers require multiple low power clock cycles for the compare value set by `ticker_set_interrupt` to take effect. Further complicating this issue, a new compare value typically cannot be set until the first has taken effect. Because of this when back to back calls to `ticker_set_interrupt` are made without a delay the second call will block and violate the above requirement that `ticker_set_interrupt` completes in 20us.
42+
43+
To meet this timing requirement targets which have this synchronization delay must define `LOWPOWERTIMER_DELAY_TICKS` to the number of low power clock cycles it takes for call to `ticker_set_interrupt` to take effect. When this value is set the timer code will prevent `lp_ticker_set_interrupt` from being called twice within that number of clock cycles. It does this by using the microsecond time to schedule the write to happen at a future date.
44+
3945
### Dependencies
4046

4147
Hardware low power ticker capabilities.

0 commit comments

Comments
 (0)