From 9484f95fed5f534faf492370a672f5deff67f40f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Mon, 25 Nov 2019 17:03:46 +0100 Subject: i2s uses PRCI_get_cpu_freq --- code/fe310/eos/i2s.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'code') 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); -- cgit v1.2.3