runtime/nrf: Add Sleep()

This commit is contained in:
Ayke van Laethem
2018-04-26 23:47:59 +02:00
parent 4491a63fe8
commit d4170faa0a
3 changed files with 34 additions and 1 deletions
+2 -1
View File
@@ -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() {