all: use groupName in peripherals

This is needed for support for multiple instances of a peripheral type.
This commit is contained in:
Ayke van Laethem
2018-09-21 22:24:41 +02:00
parent 110230a50d
commit 9fa08bf51d
3 changed files with 47 additions and 17 deletions
+4 -4
View File
@@ -64,8 +64,8 @@ func init() {
}
func initUART() {
nrf.UART0.ENABLE = nrf.UART0_ENABLE_ENABLE_Enabled
nrf.UART0.BAUDRATE = nrf.UART0_BAUDRATE_BAUDRATE_Baud115200
nrf.UART0.ENABLE = nrf.UART_ENABLE_ENABLE_Enabled
nrf.UART0.BAUDRATE = nrf.UART_BAUDRATE_BAUDRATE_Baud115200
nrf.UART0.TASKS_STARTTX = 1
nrf.UART0.PSELTXD = 6 // pin 6 for NRF52840-DK
}
@@ -139,7 +139,7 @@ type __volatile bool
var rtc_wakeup __volatile
func rtc_sleep(ticks uint32) {
nrf.RTC0.INTENSET = nrf.RTC0_INTENSET_COMPARE0_Msk
nrf.RTC0.INTENSET = nrf.RTC_INTENSET_COMPARE0_Msk
rtc_wakeup = false
if ticks == 1 {
// Race condition (even in hardware) at ticks == 1.
@@ -155,7 +155,7 @@ func rtc_sleep(ticks uint32) {
//go:export RTC0_IRQHandler
func handleRTC0() {
nrf.RTC0.INTENCLR = nrf.RTC0_INTENSET_COMPARE0_Msk
nrf.RTC0.INTENCLR = nrf.RTC_INTENSET_COMPARE0_Msk
nrf.RTC0.EVENTS_COMPARE[0] = 0
rtc_wakeup = true
}