Hi,
Good day!
In our application, we are using the SPI protocol to communicate with the LED driver. For a graphic effect like text scroll on the screen, we used nrf_delay_ms() function but this is blocking the CPU time. So we decided to go with the app_timer library to implement this text scroll effect and other graphics.
Problem:
When this app timer is used to have the delay effect, the nrf_drv_spi_xfer() is not entering into the SPI transfer done handler and the m_xfer_done flag is never updated, therefore its i stuck in this while loop.
while (!spi_xfer_done) {
__WFE();
}
I appreciate any help in this regard.
/**LED SPI transfer function**/ __STATIC_INLINE void led_spi_transfer(uint8_t led_array[]) { if (led_array[0] != 0); else if (led_array[0] == 0) return; //Reset rx buffer and transfer done flag memset(m_rx_buf, 0, m_length); spi_xfer_done = false; APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, led_array, m_length, m_rx_buf, m_length)); while (!spi_xfer_done) { __WFE(); } nrf_delay_us(1); }