KC60 refactor (#10834)
This commit is contained in:
parent
38162af5a7
commit
c60cafae41
10 changed files with 338 additions and 295 deletions
|
@ -1,16 +1,13 @@
|
|||
#include "kc60.h"
|
||||
|
||||
void led_set_kb(uint8_t usb_led)
|
||||
{
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
// output low
|
||||
DDRB |= (1<<2);
|
||||
PORTB &= ~(1<<2);
|
||||
} else {
|
||||
// Hi-Z
|
||||
DDRB &= ~(1<<2);
|
||||
PORTB &= ~(1<<2);
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
if (led_state.caps_lock) {
|
||||
setPinOutput(B2);
|
||||
} else {
|
||||
setPinInput(B2);
|
||||
}
|
||||
}
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue