Skip to content

Commit 74160c0

Browse files
committed
runtime/atsamd51: enable CMCC cache for greatly improved performance on SAMD51
Signed-off-by: deadprogram <ron@hybridgroup.com>
1 parent 6e1b8a5 commit 74160c0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/runtime/runtime_atsamd51.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func init() {
2727
initSERCOMClocks()
2828
initUSBClock()
2929
initADCClock()
30+
enableCache()
3031

3132
cdc.EnableUSBCDC()
3233
machine.USBDev.Configure(machine.UARTConfig{})
@@ -367,6 +368,10 @@ func initADCClock() {
367368
sam.GCLK_PCHCTRL_CHEN)
368369
}
369370

371+
func enableCache() {
372+
sam.CMCC.CTRL.SetBits(sam.CMCC_CTRL_CEN)
373+
}
374+
370375
func waitForEvents() {
371376
arm.Asm("wfe")
372377
}

0 commit comments

Comments
 (0)