mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
fix(rp2): disable DBGPAUSE on startup
This commit is contained in:
@@ -58,6 +58,10 @@ func machineInit() {
|
||||
|
||||
// Peripheral clocks should now all be running
|
||||
unresetBlockWait(RESETS_RESET_Msk)
|
||||
|
||||
// DBGPAUSE pauses the timer when a debugger is connected. This prevents
|
||||
// sleep functions from ever returning, so disable it.
|
||||
timer.setDbgPause(false)
|
||||
}
|
||||
|
||||
//go:linkname ticks runtime.machineTicks
|
||||
|
||||
@@ -101,3 +101,15 @@ func (tmr *timerType) lightSleep(us uint64) {
|
||||
// Disable interrupt
|
||||
intr.Disable()
|
||||
}
|
||||
|
||||
// setDbgPause sets whether this timer is paused when a debugger is connected.
|
||||
func (tmr *timerType) setDbgPause(enable bool) {
|
||||
const bitPos = 1
|
||||
const bitMask = 0b11
|
||||
val := uint32(0b00)
|
||||
if enable {
|
||||
// Disable timer when debugger is connected to either core.
|
||||
val = 0b11
|
||||
}
|
||||
tmr.dbgPause.ReplaceBits(val, bitMask, bitPos)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user