mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
runtime/nrf: Add Sleep()
This commit is contained in:
@@ -8,6 +8,7 @@ import "C"
|
||||
|
||||
func init() {
|
||||
C.uart_init(6) // pin_tx = 6, for NRF52840-DK
|
||||
C.rtc_init()
|
||||
}
|
||||
|
||||
const Microsecond = 1
|
||||
@@ -17,7 +18,7 @@ func putchar(c byte) {
|
||||
}
|
||||
|
||||
func Sleep(d Duration) {
|
||||
// TODO
|
||||
C.rtc_sleep(C.uint32_t(d / 32)) // TODO: not accurate (must be d / 30.5175...)
|
||||
}
|
||||
|
||||
func abort() {
|
||||
|
||||
Reference in New Issue
Block a user