rename package machine/usb2 to machine/usb

This commit is contained in:
ardnew
2021-04-20 21:16:06 -05:00
committed by sago35
parent 69e8257e7b
commit 079eace344
24 changed files with 207 additions and 4502 deletions
+16
View File
@@ -0,0 +1,16 @@
// +build arm
package usb
import "device/arm"
// 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.
//go:inline
func udelay(microsec uint32) {
n := cycles(microsec, descCPUFrequencyHz)
for i := uint32(0); i < n; i++ {
arm.Asm(`nop`)
}
}