Add keyboard backlight SCI

This commit is contained in:
Jeremy Soller
2020-01-28 15:02:41 -07:00
parent edbb6136dc
commit 0c4d0fbe0b
5 changed files with 23 additions and 2 deletions

View File

@@ -10,6 +10,8 @@
bool kbscan_enabled = false;
uint8_t sci_extra = 0;
void kbscan_init(void) {
KSOCTRL = 0x05;
KSICTRLR = 0x04;
@@ -98,6 +100,15 @@ void kbscan_event(void) {
if (new_b) layer = 1;
else layer = 0;
break;
case (KT_SCI_EXTRA):
if (new_b) {
uint8_t sci = SCI_EXTRA;
sci_extra = (uint8_t)(key & 0xFF);
if (!pmc_sci(&PMC_1, sci)) {
// In the case of ignored SCI, reset bit
new &= ~(1 << j);
}
}
case (KT_SCI):
if (new_b) {
uint8_t sci = (uint8_t)(key & 0xFF);