diff options
author | fauxpark <fauxpark@gmail.com> | 2020-01-26 07:43:43 +1100 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2020-01-25 12:43:43 -0800 |
commit | 480a391929de9e66d36c84df900c49297c7dfec0 (patch) | |
tree | d37d22e5dcca10c4560650be99c0cd85158d6f70 /keyboards/daisy/daisy.c | |
parent | 154336ee2747eafee23a13073203cd984dc999b5 (diff) |
[Keyboard] Daisy refactor (#7985)
Diffstat (limited to 'keyboards/daisy/daisy.c')
-rw-r--r-- | keyboards/daisy/daisy.c | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/keyboards/daisy/daisy.c b/keyboards/daisy/daisy.c index f8ca24ff0b..4e365ed462 100644 --- a/keyboards/daisy/daisy.c +++ b/keyboards/daisy/daisy.c @@ -1,15 +1,35 @@ +/* Copyright 2020 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + #include "daisy.h" -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - if (usb_led & (1<<USB_LED_CAPS_LOCK)) { - // output low - DDRC |= (1<<PC6); - PORTC &= ~(1<<PC6); - } else { - // Hi-Z - DDRC &= ~(1<<PC6); - PORTC &= ~(1<<PC6); - } - led_set_user(usb_led); -}
\ No newline at end of file +void keyboard_pre_init_kb(void) { + led_init_ports(); + keyboard_pre_init_user(); +} + +void led_init_ports(void) { + setPinOutput(C6); + writePinHigh(C6); +} + +bool led_update_kb(led_t led_state) { + if (led_update_user(led_state)) { + writePin(C6, !led_state.caps_lock); + } + + return true; +} |