From 8745f7c29470ec2267eb5b90e4644499200bafd3 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Mon, 10 Jun 2024 15:21:47 -0400 Subject: move io config to board.c --- main.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 6cb6eaa..0473d6e 100644 --- a/main.cpp +++ b/main.cpp @@ -66,20 +66,6 @@ int main(void) halInit(); osalSysEnable(); - palSetLineMode(LINE_LED0, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED0); - palSetLineMode(LINE_LED1, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED1); - palSetLineMode(LINE_LED2, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED2); - palSetLineMode(LINE_LED3, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED3); - palSetLineMode(LINE_LED4, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED4); - palSetLineMode(LINE_LED5, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED5); - palSetLineMode(LINE_LED6, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED6); - palSetLineMode(LINE_LED7, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED7); - palSetLineMode(LINE_LED8, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED8); - palSetLineMode(LINE_LED9, PAL_MODE_OUTPUT_PUSHPULL); palSetLine(LINE_LED9); - palSetLineMode(LINE_I2S_SD, PAL_MODE_ALTERNATE(0)); - palSetLineMode(LINE_I2S_WS, PAL_MODE_ALTERNATE(0)); - palSetLineMode(LINE_I2S_CK, PAL_MODE_ALTERNATE(0)); - i2sReady.store(true); i2sStart(&I2SD1, &i2sConfig); i2sStartExchange(&I2SD1); @@ -95,7 +81,9 @@ int main(void) for (;;) { i2sReady.store(false); SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk; + //palClearLine(LINE_TP1); __WFI(); + //palSetLine(LINE_TP1); const auto sum_sqr = std::exchange(Leq_sum_sqr, sos_t(0.f)); const auto count = std::exchange(Leq_samples, 0); @@ -148,6 +136,8 @@ void i2sCallback(I2SDriver *i2s) if (i2sReady.load()) return; + //palSetLine(LINE_TP1); + const auto halfsize = i2sBuffer.size() / 2; const auto source = i2sBuffer.data() + (i2sIsBufferComplete(i2s) ? halfsize : 0); auto samples = reinterpret_cast(source); @@ -168,5 +158,7 @@ void i2sCallback(I2SDriver *i2s) i2sReady.store(true); SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; } + + //palClearLine(LINE_TP1); } -- cgit v1.2.3