mirror of
https://github.com/clockworkpi/PicoCalc.git
synced 2025-12-12 10:18:54 +01:00
Allow setting keyboard backlight via i2c
This hooks up the write portion of REG_ID_BK2 closes: https://github.com/clockworkpi/PicoCalc/issues/13
This commit is contained in:
parent
4c65694629
commit
f9a60c1590
@ -137,6 +137,17 @@ void receiveEvent(int howMany) {
|
||||
write_buffer[0] = reg;
|
||||
write_buffer[1] = reg_get_value(REG_ID_BKL);
|
||||
} break;
|
||||
case REG_ID_BK2: {
|
||||
if (is_write) {
|
||||
reg_set_value(REG_ID_BK2, rcv_data[1]);
|
||||
// kbd_backlight_update will add 0 to the reg
|
||||
// value that we just set, and apply the result
|
||||
// to the backlight
|
||||
kbd_backlight_update(0);
|
||||
}
|
||||
write_buffer[0] = reg;
|
||||
write_buffer[1] = reg_get_value(REG_ID_BK2);
|
||||
} break;
|
||||
case REG_ID_BAT:{
|
||||
//Serial1.print("REG_ID_BAT getBatteryPercent:");Serial1.print(current_bat_pcnt);Serial1.println("%");
|
||||
write_buffer[0] = reg;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user