mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 00:13:43 +00:00
begin isolating target-specific USB code
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user