diff options
author | Ayke van Laethem <[email protected]> | 2019-12-16 19:59:30 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-12-16 20:34:39 +0100 |
commit | 768c652468a56cb797f151104e28e19ec52ae3dc (patch) | |
tree | 8089842e76ac3c6223a0bb73482297affd5ddb67 /src/machine/machine_nrf52.go | |
parent | 2778377ac9c295b45339b6ebc4e8b88b8e40f9db (diff) | |
download | tinygo-768c652468a56cb797f151104e28e19ec52ae3dc.tar.gz tinygo-768c652468a56cb797f151104e28e19ec52ae3dc.zip |
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.
Diffstat (limited to 'src/machine/machine_nrf52.go')
-rw-r--r-- | src/machine/machine_nrf52.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/machine/machine_nrf52.go b/src/machine/machine_nrf52.go index b661aecf6..392e237c3 100644 --- a/src/machine/machine_nrf52.go +++ b/src/machine/machine_nrf52.go @@ -7,7 +7,9 @@ import ( "unsafe" ) -const CPU_FREQUENCY = 64000000 +func CPUFrequency() uint32 { + return 64000000 +} // Get peripheral and pin number for this GPIO pin. func (p Pin) getPortPin() (*nrf.GPIO_Type, uint32) { |