mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 23:43:40 +00:00
runtime/samd21: set minimum sleep to 214us due to minimum delay in register synchronization
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
@@ -261,9 +261,12 @@ func ticks() timeUnit {
|
|||||||
// ticks are in microseconds
|
// ticks are in microseconds
|
||||||
func timerSleep(ticks uint32) {
|
func timerSleep(ticks uint32) {
|
||||||
timerWakeup.Set(0)
|
timerWakeup.Set(0)
|
||||||
if ticks < 30 {
|
if ticks < 214 {
|
||||||
// have to have at least one clock count
|
// due to around 183us delay waiting for the register value to sync, the minimum sleep value
|
||||||
ticks = 30
|
// for the SAMD21 is 214us.
|
||||||
|
// For related info, see:
|
||||||
|
// https://community.atmel.com/comment/2507091#comment-2507091
|
||||||
|
ticks = 214
|
||||||
}
|
}
|
||||||
|
|
||||||
// request read of count
|
// request read of count
|
||||||
|
|||||||
Reference in New Issue
Block a user