void artnet_main(void) { if (get_dmx_slot_state(artnet_inputUniverse, artnet_conn_id) == DMX_NEWVALUES && artnet_connected == TRUE) { ARTNET_DEBUG("Universe has changed, sending artnet data!\r\n"); artnet_sendDmxPacket(); } }
void stella_process(void) { #ifdef DMX_STORAGE_SUPPORT if (get_dmx_slot_state(STELLA_UNIVERSE, stella_dmx_conn_id) == DMX_NEWVALUES) { uint8_t mode = get_dmx_channel_slot(STELLA_UNIVERSE, STELLA_UNIVERSE_OFFSET, stella_dmx_conn_id); for (uint8_t i = 0; i < STELLA_CHANNELS; i++) { stella_setValue(mode, i, get_dmx_channel_slot(STELLA_UNIVERSE, STELLA_UNIVERSE_OFFSET + i + 1, stella_dmx_conn_id)); } } #endif /* the main loop is too fast, slow down */ if (stella_fade_counter == 0) { uint8_t i; /* Fade channels. stella_fade_counter is 0 currently. Set to 1 * if fading changed a channel brigthness value */ for (i = 0; i < STELLA_CHANNELS; ++i) { if (stella_brightness[i] == stella_fade[i]) continue; stella_fade_funcs[stella_fade_func].p(i); stella_fade_counter = 1; } if (stella_fade_counter) stella_sync = UPDATE_VALUES; /* reset counter */ stella_fade_counter = stella_fade_step; } /* sort if new values are available */ if (stella_sync == UPDATE_VALUES) stella_sort(); }
void ws2801_main(void) { if ((get_dmx_slot_state(WS2801_UNIVERSE, dmx_conn_id) == DMX_NEWVALUES)&&(ws2801 == 1)) { uint8_t tmp = 0; for(uint8_t i = 0; i < WS2801_CHANNELS; i++) { tmp = get_dmx_channel_slot(WS2801_UNIVERSE, i + WS2801_OFFSET, dmx_conn_id); ws2801_writeByte((uint8_t)tmp); } ws2801_showPixel(); } }