mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 10:43:29 +00:00
machine/rp2040: refactor PWM code. fix Period calculation
This commit is contained in:
committed by
Ron Evans
parent
348a02d697
commit
bf0b05e32c
@@ -18,6 +18,12 @@ func CPUFrequency() uint32 {
|
||||
return 125 * MHz
|
||||
}
|
||||
|
||||
// Returns the period of a clock cycle for the raspberry pi pico in nanoseconds.
|
||||
// Used in PWM API.
|
||||
func cpuPeriod() uint32 {
|
||||
return 1e9 / CPUFrequency()
|
||||
}
|
||||
|
||||
// clockIndex identifies a hardware clock
|
||||
type clockIndex uint8
|
||||
|
||||
|
||||
Reference in New Issue
Block a user