Created
August 19, 2017 03:14
-
-
Save electronut/0232ba246146e16da5ac4b25f8b5bc46 to your computer and use it in GitHub Desktop.
main loop i2s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (;;) | |
{ | |
// start I2S | |
if(g_i2s_start && !g_i2s_running) { | |
err_code = nrf_drv_i2s_start(0, m_buffer_tx, I2S_BUFFER_SIZE, 0); | |
APP_ERROR_CHECK(err_code); | |
g_i2s_running = true; | |
} | |
// stop I2S | |
if(!g_i2s_start && g_i2s_running) { | |
nrf_drv_i2s_stop(); | |
g_i2s_running = false; | |
} | |
nrf_delay_ms(250); | |
// update | |
if (g_i2s_running) { | |
nled = (nled + 1) % NLEDS; | |
set_led_data(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment