machine/rp2040: add interrupt API

This commit is contained in:
soypat
2021-10-30 16:56:39 -03:00
committed by Ron Evans
parent 6c02b4956c
commit b534dd67e0
3 changed files with 189 additions and 0 deletions
+9
View File
@@ -1,3 +1,4 @@
//go:build rp2040
// +build rp2040
package machine
@@ -114,3 +115,11 @@ func init() {
UART0.Interrupt = interrupt.New(rp.IRQ_UART0_IRQ, _UART0.handleInterrupt)
UART1.Interrupt = interrupt.New(rp.IRQ_UART1_IRQ, _UART1.handleInterrupt)
}
// CurrentCore returns the core number the call was made from.
func CurrentCore() int {
return int(rp.SIO.CPUID.Get())
}
// NumCores returns number of cores available on the device.
func NumCores() int { return 2 }