Created
August 18, 2017 07:21
-
-
Save electronut/c1899c5617b60eb63453b022c484d1ce to your computer and use it in GitHub Desktop.
set led data
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
void set_led_data() | |
{ | |
for(int i = 0; i < 3*NLEDS; i += 3) { | |
if (i == 3*nled) { | |
switch(g_demo_mode) | |
{ | |
case 0: | |
{ | |
m_buffer_tx[i] = 0x88888888; | |
m_buffer_tx[i+1] = caclChannelValue(128); | |
m_buffer_tx[i+2] = 0x88888888; | |
} | |
break; | |
case 1: | |
{ | |
m_buffer_tx[i] = caclChannelValue(128);; | |
m_buffer_tx[i+1] = 0x88888888; | |
m_buffer_tx[i+2] = 0x88888888; | |
} | |
break; | |
case 2: | |
{ | |
m_buffer_tx[i] = 0x88888888; | |
m_buffer_tx[i+1] = 0x88888888; | |
m_buffer_tx[i+2] = caclChannelValue(128); | |
} | |
break; | |
default: | |
break; | |
} | |
} | |
else { | |
m_buffer_tx[i] = 0x88888888; | |
m_buffer_tx[i+1] = 0x88888888; | |
m_buffer_tx[i+2] = 0x88888888; | |
} | |
} | |
// reset | |
for(int i = 3*NLEDS; i < I2S_BUFFER_SIZE; i++) { | |
m_buffer_tx[i] = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment