mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +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
|
||||
func timerSleep(ticks uint32) {
|
||||
timerWakeup.Set(0)
|
||||
if ticks < 30 {
|
||||
// have to have at least one clock count
|
||||
ticks = 30
|
||||
if ticks < 214 {
|
||||
// due to around 183us delay waiting for the register value to sync, the minimum sleep value
|
||||
// for the SAMD21 is 214us.
|
||||
// For related info, see:
|
||||
// https://community.atmel.com/comment/2507091#comment-2507091
|
||||
ticks = 214
|
||||
}
|
||||
|
||||
// request read of count
|
||||
|
||||
Reference in New Issue
Block a user