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

Method SetLEDs

Controllers/FanBusController/FanBusController.cpp:32–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void FanBusController::SetLEDs(std::vector<RGBColor> colors)
33{
34 for(unsigned int led_idx = 0; led_idx < 4; led_idx++)
35 {
36 unsigned char red = RGBGetRValue(colors[led_idx]);
37 unsigned char grn = RGBGetGValue(colors[led_idx]);
38 unsigned char blu = RGBGetBValue(colors[led_idx]);
39
40 bus->write_queue(dev, 0x10 + (led_idx * 3), red);
41 bus->write_queue(dev, 0x11 + (led_idx * 3), grn);
42 bus->write_queue(dev, 0x12 + (led_idx * 3), blu);
43 }
44
45 bus->write_queue(dev, 0x0C, 0x01);
46
47 bus->process_queue();
48}

Callers 3

DeviceUpdateLEDsMethod · 0.45
UpdateZoneLEDsMethod · 0.45
UpdateSingleLEDMethod · 0.45

Calls 2

write_queueMethod · 0.80
process_queueMethod · 0.80

Tested by

no test coverage detected