From 048197ad519fd3bc1d05a15a7d4fb0a87270c635 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 17 Mar 2018 02:17:22 +0100 Subject: i2s start/stop fixed properly --- code/fe310/eos/i2s.c | 41 ++++++++++++++++++++++++++++++++--------- code/fe310/eos/i2s.h | 4 ++-- 2 files changed, 34 insertions(+), 11 deletions(-) (limited to 'code/fe310/eos') diff --git a/code/fe310/eos/i2s.c b/code/fe310/eos/i2s.c index 47be820..b771495 100644 --- a/code/fe310/eos/i2s.c +++ b/code/fe310/eos/i2s.c @@ -22,8 +22,8 @@ uint32_t _eos_i2s_mic_wm = 0; uint32_t _eos_i2s_spk_wm = 0; uint32_t _eos_i2s_mic_volume = 3; uint32_t _eos_i2s_spk_volume = 3; -uint32_t _eos_i2s_mic_rd = 1; -uint32_t _eos_i2s_spk_wr = 1; +uint32_t _eos_i2s_mic_rd = 0; +uint32_t _eos_i2s_spk_wr = 0; static eos_evt_fptr_t evt_handler[I2S_MAX_HANDLER]; static void _abuf_init(EOSABuf *buf, uint8_t *array, uint16_t size) { @@ -121,30 +121,44 @@ void eos_i2s_init(void) { I2S_PWM_REG_WS(PWM_CMP1) = (_eos_i2s_ck_period + 1) * 32; I2S_PWM_REG_WS(PWM_CMP2) = (_eos_i2s_ck_period + 1) * 62; - eos_intr_set(I2S_IRQ_SD_ID, I2S_IRQ_SD_PRIORITY, NULL); - eos_intr_set(I2S_IRQ_CK_ID, I2S_IRQ_CK_PRIORITY, NULL); - eos_intr_set(I2S_IRQ_WS_ID, I2S_IRQ_WS_PRIORITY, NULL); - eos_intr_set(I2S_IRQ_CI_ID, I2S_IRQ_CI_PRIORITY, NULL); - + eos_intr_set(I2S_IRQ_SD_ID, 0, NULL); + eos_intr_set(I2S_IRQ_CK_ID, 0, NULL); + eos_intr_set(I2S_IRQ_WS_ID, 0, NULL); + eos_intr_set(I2S_IRQ_CI_ID, 0, NULL); for (i=0; i