begin isolating target-specific USB code

This commit is contained in:
ardnew
2021-04-27 10:14:23 -05:00
committed by sago35
parent 07964818d9
commit 34b931b6f3
12 changed files with 1968 additions and 1742 deletions
+11
View File
@@ -4,6 +4,9 @@ package usb
import "device/arm"
//go:linkname ticks runtime.ticks
func ticks() int64
// udelay waits for the given number of microseconds before returning.
// We cannot use the sleep timer from this context (import cycle), but we need
// an approximate method to spin CPU cycles for short periods of time.
@@ -14,3 +17,11 @@ func udelay(microsec uint32) {
arm.Asm(`nop`)
}
}
func disableInterrupts() uintptr {
return arm.DisableInterrupts()
}
func enableInterrupts(mask uintptr) {
arm.EnableInterrupts(mask)
}