diff options
Diffstat (limited to 'keyboards/freyr/freyr.c')
| -rw-r--r-- | keyboards/freyr/freyr.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/keyboards/freyr/freyr.c b/keyboards/freyr/freyr.c index 68c26294f..336b32711 100644 --- a/keyboards/freyr/freyr.c +++ b/keyboards/freyr/freyr.c | |||
| @@ -13,33 +13,24 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "freyr.h" | ||
| 17 | 16 | ||
| 17 | #include "freyr.h" | ||
| 18 | 18 | ||
| 19 | void matrix_init_kb(void) { | 19 | void matrix_init_kb(void) { |
| 20 | matrix_init_user(); | 20 | matrix_init_user(); |
| 21 | led_init_ports(); | 21 | led_init_ports(); |
| 22 | }; | 22 | } |
| 23 | 23 | ||
| 24 | void led_init_ports(void) { | 24 | void led_init_ports(void) { |
| 25 | setPinOutput(B3); | 25 | setPinOutput(B3); |
| 26 | setPinOutput(B7); | 26 | setPinOutput(B7); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void led_set_kb(uint8_t usb_led) { | 29 | bool led_update_kb(led_t led_state) { |
| 30 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | 30 | if (led_update_user(led_state)) { |
| 31 | // Turn Caps Lock LED on | 31 | writePin(B3, !led_state.caps_lock); |
| 32 | writePinLow(B3); | 32 | writePin(B7, !led_state.scroll_lock); |
| 33 | } else { | 33 | } |
| 34 | // Turn Caps Lock LED off | 34 | |
| 35 | writePinHigh(B3); | 35 | return true; |
| 36 | } | ||
| 37 | if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { | ||
| 38 | // Turn Scroll Lock LED on | ||
| 39 | writePinLow(B7); | ||
| 40 | } else { | ||
| 41 | // Turn Scroll Lock LED off | ||
| 42 | writePinHigh(B7); | ||
| 43 | } | ||
| 44 | led_set_user(usb_led); | ||
| 45 | } | 36 | } |
