mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
machine: rename CPU_FREQUENCY -> CPUFrequency()
These all-caps constants aren't in the Go style, so rename it to CPUFrequency (which is more aligned with Go style). Additionally, make it a function so that it is possible to add support for changing the frequency in the future. Tested by running `make smoketest`. None of the outputs did change.
This commit is contained in:
committed by
Ron Evans
parent
2778377ac9
commit
768c652468
@@ -163,7 +163,7 @@ func timerSleep(ticks uint32) {
|
||||
// The current scaling only supports a range of 200 usec to 6553 msec.
|
||||
|
||||
// prescale counter down from 72mhz to 10khz aka 0.1 ms frequency.
|
||||
stm32.TIM3.PSC.Set(machine.CPU_FREQUENCY/10000 - 1) // 7199
|
||||
stm32.TIM3.PSC.Set(machine.CPUFrequency()/10000 - 1) // 7199
|
||||
|
||||
// Set duty aka duration.
|
||||
// STM32 dividers use n-1, i.e. n counts from 0 to n-1.
|
||||
|
||||
Reference in New Issue
Block a user