aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/machine_rp2040.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine/machine_rp2040.go')
-rw-r--r--src/machine/machine_rp2040.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/machine/machine_rp2040.go b/src/machine/machine_rp2040.go
index 297c92e3b..1d86f2082 100644
--- a/src/machine/machine_rp2040.go
+++ b/src/machine/machine_rp2040.go
@@ -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 }