diff options
author | Uros Majstorovic <majstor@majstor.org> | 2019-11-25 17:03:46 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2019-11-25 17:03:46 +0100 |
commit | 9484f95fed5f534faf492370a672f5deff67f40f (patch) | |
tree | c10b5641cb76278298de262591982dddac384b5c /code/fe310 | |
parent | 898780a7c2b410793ca0dc60887b8e985b777b14 (diff) |
i2s uses PRCI_get_cpu_freq
Diffstat (limited to 'code/fe310')
-rw-r--r-- | code/fe310/eos/i2s.c | 5 |
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); |