summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2019-11-25 17:03:46 +0100
committerUros Majstorovic <majstor@majstor.org>2019-11-25 17:03:46 +0100
commit9484f95fed5f534faf492370a672f5deff67f40f (patch)
treec10b5641cb76278298de262591982dddac384b5c
parent898780a7c2b410793ca0dc60887b8e985b777b14 (diff)
i2s uses PRCI_get_cpu_freq
-rw-r--r--code/fe310/eos/i2s.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/code/fe310/eos/i2s.c b/code/fe310/eos/i2s.c
index 3cc0619..8c7096e 100644
--- a/code/fe310/eos/i2s.c
+++ b/code/fe310/eos/i2s.c
@@ -118,10 +118,7 @@ void eos_i2s_init(void) {
}
void eos_i2s_start(uint32_t sample_rate, unsigned char fmt) {
- // Ignore the first run (for icache reasons)
- uint32_t cpu_freq = PRCI_measure_mcycle_freq(3000, RTC_FREQ);
- cpu_freq = PRCI_measure_mcycle_freq(3000, RTC_FREQ);
- uint32_t ck_period = (cpu_freq / (sample_rate * 64)) & ~I2S_PWM_SCALE_CK_MASK;;
+ uint32_t ck_period = (PRCI_get_cpu_freq() / (sample_rate * 64)) & ~I2S_PWM_SCALE_CK_MASK;;
GPIO_REG(GPIO_INPUT_EN) &= ~(1 << I2S_PIN_CK);
GPIO_REG(GPIO_OUTPUT_EN) |= (1 << I2S_PIN_CK);