MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / DeviceUpdateLEDs

Method DeviceUpdateLEDs

Controllers/DMXController/RGBController_DMX.cpp:171–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void RGBController_DMX::DeviceUpdateLEDs()
172{
173 last_update_time = std::chrono::steady_clock::now();
174
175 unsigned char dmx_data[513];
176
177 memset(dmx_data, 0, sizeof(dmx_data));
178
179 for(unsigned int device_idx = 0; device_idx < devices.size(); device_idx++)
180 {
181 if(devices[device_idx].brightness_channel > 0)
182 {
183 dmx_data[devices[device_idx].brightness_channel] = modes[0].brightness;
184 }
185
186 if(devices[device_idx].red_channel > 0)
187 {
188 dmx_data[devices[device_idx].red_channel] = RGBGetRValue(colors[device_idx]);
189 }
190
191 if(devices[device_idx].green_channel > 0)
192 {
193 dmx_data[devices[device_idx].green_channel] = RGBGetGValue(colors[device_idx]);
194 }
195
196 if(devices[device_idx].blue_channel > 0)
197 {
198 dmx_data[devices[device_idx].blue_channel] = RGBGetBValue(colors[device_idx]);
199 }
200 }
201
202 port->serial_break();
203 port->serial_write((char*)&dmx_data, sizeof(dmx_data));
204}
205
206void RGBController_DMX::UpdateZoneLEDs(int /*zone*/)
207{

Callers

nothing calls this directly

Calls 3

serial_breakMethod · 0.80
serial_writeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected