mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
all: change special type __volatile to pragma //go:volatile
This is one step towards removing unnecessary special casts in most cases. It is also part of removing as much magic as possible from the compiler (the pragma is explicit, the special name is not).
This commit is contained in:
@@ -33,8 +33,8 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type __volatile uint32
|
||||
type RegValue = __volatile
|
||||
//go:volatile
|
||||
type RegValue uint32
|
||||
|
||||
type __asm string
|
||||
|
||||
@@ -47,7 +47,7 @@ const (
|
||||
|
||||
// Nested Vectored Interrupt Controller (NVIC).
|
||||
type NVIC_Type struct {
|
||||
ISER [8]__volatile
|
||||
ISER [8]RegValue
|
||||
}
|
||||
|
||||
var NVIC = (*NVIC_Type)(unsafe.Pointer(uintptr(NVIC_BASE)))
|
||||
|
||||
@@ -81,9 +81,10 @@ func ticks() timeUnit {
|
||||
return timestamp
|
||||
}
|
||||
|
||||
type __volatile bool
|
||||
//go:volatile
|
||||
type isrFlag bool
|
||||
|
||||
var rtc_wakeup __volatile
|
||||
var rtc_wakeup isrFlag
|
||||
|
||||
func rtc_sleep(ticks uint32) {
|
||||
nrf.RTC0.INTENSET = nrf.RTC_INTENSET_COMPARE0
|
||||
|
||||
Reference in New Issue
Block a user