SIMPLIFY! Always run the main clock at 8 MHz

This commit is contained in:
Joey Castillo
2021-08-30 14:03:43 -04:00
parent 27ce7003b3
commit 53053ad89a
7 changed files with 11 additions and 60 deletions

View File

@@ -41,7 +41,6 @@
#endif
#include <utils_assert.h>
#include <peripheral_clk_config.h>
#include "watch.h"
#ifndef CONF_CPU_FREQUENCY
#define CONF_CPU_FREQUENCY 1000000
@@ -168,9 +167,7 @@ static inline uint32_t _get_cycles_for_us_internal(const uint16_t us, const uint
*/
uint32_t _get_cycles_for_us(const uint16_t us)
{
uint32_t freq = watch_get_cpu_speed();
if (freq > 10000000) return _get_cycles_for_us_internal(us, freq, 8);
else return _get_cycles_for_us_internal(us, freq, 7);
return _get_cycles_for_us_internal(us, CONF_CPU_FREQUENCY, CPU_FREQ_POWER);
}
/**
@@ -199,7 +196,5 @@ static inline uint32_t _get_cycles_for_ms_internal(const uint16_t ms, const uint
*/
uint32_t _get_cycles_for_ms(const uint16_t ms)
{
uint32_t freq = watch_get_cpu_speed();
if (freq > 10000000) return _get_cycles_for_ms_internal(ms, freq, 8);
else return _get_cycles_for_ms_internal(ms, freq, 7);
return _get_cycles_for_ms_internal(ms, CONF_CPU_FREQUENCY, CPU_FREQ_POWER);
}