diff --git a/App/App.cpp b/App/App.cpp index 1befa0f..964e63e 100644 --- a/App/App.cpp +++ b/App/App.cpp @@ -65,9 +65,11 @@ void StartSparkle( Sparkle &s ) #endif } -extern "C" void HandleSpiDmaIrq() +extern "C" void DMA1_Channel3_IRQHandler(void) { + LL_GPIO_TogglePin(GPIOA, LL_GPIO_PIN_0); g_strip.SpiDmaIsr(); + LL_GPIO_TogglePin(GPIOA, LL_GPIO_PIN_0); } void TimerCallback(TimerHandle_t th) diff --git a/App/WS28xxStrip.h b/App/WS28xxStrip.h index b34f265..158cd32 100644 --- a/App/WS28xxStrip.h +++ b/App/WS28xxStrip.h @@ -23,7 +23,7 @@ struct pixel_t { uint8_t b; }; -extern "C" void HandleSpiDmaIrq(); +extern "C" void DMA1_Channel3_IRQHandler(void); template class WS28xxStrip { public: @@ -31,7 +31,7 @@ public: pixel_t& operator[](int16_t index); - friend void HandleSpiDmaIrq(); + friend void DMA1_Channel3_IRQHandler(void); void Update(); static void RefillTaskEntry(void *param) { reinterpret_cast*>(param)->RefillTask(); } @@ -80,6 +80,8 @@ template pixel_t& WS28xxStrip void WS28xxStrip::SpiDmaIsr() { + LL_GPIO_TogglePin(GPIOA, LL_GPIO_PIN_0); + BaseType_t woken; if(LL_DMA_IsActiveFlag_TE3(DMA1)) { @@ -112,6 +114,7 @@ template void WS28xxStrip void WS28xxStrip 0) { + LL_GPIO_TogglePin(GPIOC, LL_GPIO_PIN_13); m_endprev = m_endframe; uint8_t convert_now = Min((uint8_t)(pixels - m_pixels_converted), spi_pixels); if(convert_now) { - LL_GPIO_TogglePin(GPIOC, LL_GPIO_PIN_13); Convert((uint8_t*)&m_pixels[m_pixels_converted], m_spi_buffer[m_buffer_in_transmit ^ 1], convert_now * sizeof(pixel_t)); - LL_GPIO_TogglePin(GPIOC, LL_GPIO_PIN_13); m_pixels_converted += convert_now; } @@ -146,6 +148,7 @@ template void WS28xxStrip