summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/wm8523.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/firmware/drivers/wm8523.c b/firmware/drivers/wm8523.c
index e1711fd..ef253fb 100644
--- a/firmware/drivers/wm8523.c
+++ b/firmware/drivers/wm8523.c
@@ -104,6 +104,7 @@ static void reg_write(uint8_t portnum, char reg, const uint8_t *buf, int size)
/**
* Prepare I2S, SSP and GPIO.
*/
+#include <LPC17xx.h>
void wm8523_init(uint8_t portnum, wm8523_samplerate_t fs)
{
// Init SPI
@@ -113,9 +114,10 @@ void wm8523_init(uint8_t portnum, wm8523_samplerate_t fs)
if(portnum == 0) SSP0Init();
else SSP1Init();
-#if 1
- i2s_init();
(void)fs;
+
+#if 1
+
#else
I2SInit();
@@ -303,10 +305,9 @@ float _sin(float x)
}
#endif
-#include "../src/sample.h"
-
void wm8523_tone()
{
+ /*
// I2SSTATE 0x400A 8010
// bit 16-19 Reflects the current level of the Transmit FIFO.
uint32_t *i2sstate = (uint32_t *)0x400a8010;
@@ -321,17 +322,18 @@ void wm8523_tone()
// RX FIFO depth is 1, TX FIFO depth is 8.
//I2SStart();
- i2s_tx_start();
- LPC_I2S->I2SIRQ = (8 << 16) | (1 << 8) | (0x01 << 0);
+ //i2s_tx_start();
+ //LPC_I2S->I2SIRQ = (8 << 16) | (1 << 8) | (0x01 << 0);
//uint32_t val = 0;
uint32_t cnt = 0;
while(1) {
- while((*i2sstate & (0b1111 << 16)) != 0) { }
-
+ while((*i2sstate & (0b1111 << 16)) != 0) { cli_printf("."); }
+ if(cnt % 80 == 0) cli_printf("\n");
+ cli_printf(".");
*i2stxfifo = samples[(cnt ++) % sizeof(samples)];
}
-
+ */
#if 0
int i;