|
|
|
@ -169,7 +169,6 @@ void Model100Side::sendLEDData() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto constexpr gamma8 = kaleidoscope::driver::color::gamma_correction;
|
|
|
|
|
|
|
|
|
|
void Model100Side::sendLEDBank(byte bank) {
|
|
|
|
|
uint8_t data[LED_BYTES_PER_BANK + 1];
|
|
|
|
@ -181,20 +180,20 @@ void Model100Side::sendLEDBank(byte bank) {
|
|
|
|
|
* that results in a considerably smoother curve. */
|
|
|
|
|
uint8_t c = ledData.bytes[bank][i];
|
|
|
|
|
if (c > brightness_adjustment_)
|
|
|
|
|
c -= brightness_adjustment_;
|
|
|
|
|
c -= brightness_adjustment_;
|
|
|
|
|
else
|
|
|
|
|
c = 0;
|
|
|
|
|
c = 0;
|
|
|
|
|
|
|
|
|
|
data[i + 1] = pgm_read_byte(&gamma8[c]);
|
|
|
|
|
data[i + 1] = c;
|
|
|
|
|
}
|
|
|
|
|
uint8_t result = writeData(data, ELEMENTS(data));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Model100Side::setAllLEDsTo(cRGB color) {
|
|
|
|
|
uint8_t data[] = {TWI_CMD_LED_SET_ALL_TO,
|
|
|
|
|
pgm_read_byte(&gamma8[color.b]),
|
|
|
|
|
pgm_read_byte(&gamma8[color.g]),
|
|
|
|
|
pgm_read_byte(&gamma8[color.r])
|
|
|
|
|
color.b,
|
|
|
|
|
color.g,
|
|
|
|
|
color.r
|
|
|
|
|
};
|
|
|
|
|
uint8_t result = writeData(data, ELEMENTS(data));
|
|
|
|
|
}
|
|
|
|
@ -202,9 +201,9 @@ void Model100Side::setAllLEDsTo(cRGB color) {
|
|
|
|
|
void Model100Side::setOneLEDTo(byte led, cRGB color) {
|
|
|
|
|
uint8_t data[] = {TWI_CMD_LED_SET_ONE_TO,
|
|
|
|
|
led,
|
|
|
|
|
pgm_read_byte(&gamma8[color.b]),
|
|
|
|
|
pgm_read_byte(&gamma8[color.g]),
|
|
|
|
|
pgm_read_byte(&gamma8[color.r])
|
|
|
|
|
color.b,
|
|
|
|
|
color.g,
|
|
|
|
|
color.r
|
|
|
|
|
};
|
|
|
|
|
uint8_t result = writeData(data, ELEMENTS(data));
|
|
|
|
|
|
|
|
|
|