diff options
Diffstat (limited to 'keyboards/noxary/x268/x268.c')
| -rw-r--r-- | keyboards/noxary/x268/x268.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/keyboards/noxary/x268/x268.c b/keyboards/noxary/x268/x268.c index 3921270ac..589d59def 100644 --- a/keyboards/noxary/x268/x268.c +++ b/keyboards/noxary/x268/x268.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright 2018 Rozakiin | 1 | /* Copyright 2020 Rozakiin |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -15,39 +15,20 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #include "x268.h" | 16 | #include "x268.h" |
| 17 | 17 | ||
| 18 | // Optional override functions below. | ||
| 19 | // You can leave any or all of these undefined. | ||
| 20 | // These are only required if you want to perform custom actions. | ||
| 21 | |||
| 18 | void matrix_init_kb(void) { | 22 | void matrix_init_kb(void) { |
| 19 | // put your keyboard start-up code here | 23 | // put your keyboard start-up code here |
| 20 | // runs once when the firmware starts up | 24 | // runs once when the firmware starts up |
| 21 | 25 | setPinOutput(B0); | |
| 22 | matrix_init_user(); | 26 | matrix_init_user(); |
| 23 | } | 27 | } |
| 24 | 28 | ||
| 25 | void matrix_scan_kb(void) { | 29 | bool led_update_kb(led_t led_state) { |
| 26 | // put your looping keyboard code here | 30 | if(led_update_user(led_state)) { |
| 27 | // runs every cycle (a lot) | 31 | writePin(B0, led_state.caps_lock); |
| 28 | |||
| 29 | matrix_scan_user(); | ||
| 30 | } | ||
| 31 | |||
| 32 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 33 | // put your per-action keyboard code here | ||
| 34 | // runs for every action, just before processing by the firmware | ||
| 35 | |||
| 36 | return process_record_user(keycode, record); | ||
| 37 | } | ||
| 38 | |||
| 39 | void led_set_kb(uint8_t usb_led) { | ||
| 40 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 41 | |||
| 42 | led_set_user(usb_led); | ||
| 43 | } | ||
| 44 | |||
| 45 | void led_set_user(uint8_t usb_led) { | ||
| 46 | |||
| 47 | if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
| 48 | DDRB |= (1 << 0); PORTB |= (1 << 0); | ||
| 49 | } | ||
| 50 | else { | ||
| 51 | DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); | ||
| 52 | } | 32 | } |
| 33 | return true; | ||
| 53 | } | 34 | } |
