mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-11 18:33:43 +00:00
all: prepare for CGo changes in TinyGo
For details, see: https://github.com/tinygo-org/tinygo/pull/3927 This change just means we need to be more careful to use the right type, now that types like C.uint32_t don't match to the Go equivalent (like uint32).
This commit is contained in:
committed by
Ron Evans
parent
fd21e6ac9b
commit
715c33d4b0
+1
-1
@@ -49,7 +49,7 @@ func Sleep(duration time.Duration) {
|
||||
// * The CPU frequency is lower than 256MHz. If it is higher, long sleep
|
||||
// times (1-16ms) may not work correctly.
|
||||
cycles := uint32(duration) * (machine.CPUFrequency() / 1000_000) / 1000
|
||||
slept := C.tinygo_drivers_sleep(cycles)
|
||||
slept := C.tinygo_drivers_sleep(C.uint32_t(cycles))
|
||||
if !slept {
|
||||
// Fallback for platforms without inline assembly support.
|
||||
time.Sleep(duration)
|
||||
|
||||
Reference in New Issue
Block a user