From 607e2f6c310f2404933e791561912a0a35587aae Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Thu, 5 Mar 2020 07:26:25 +1100 Subject: YD60MQ refactor and Configurator layout support (#8313) * refactor yd60mq.h - four-space indent - use K base32hex notation - rename LAYOUT to LAYOUT_all (with alias for backwards compatibility) * refactor yd60mq.c to use led_update_kb() * align rules.mk to AVR template * refactor default keymap Also correct positions for KC_NUHS and KC_NUBS. * update readme * add Configurator layout support * initialize the Caps Lock LED pin properly --- keyboards/yd60mq/yd60mq.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'keyboards/yd60mq/yd60mq.c') diff --git a/keyboards/yd60mq/yd60mq.c b/keyboards/yd60mq/yd60mq.c index 6e391046e..a39af530d 100644 --- a/keyboards/yd60mq/yd60mq.c +++ b/keyboards/yd60mq/yd60mq.c @@ -1,12 +1,19 @@ #include "yd60mq.h" -void led_set_kb(uint8_t usb_led) { - if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { - setPinOutput(F4); - writePinLow(F4); - } else { - setPinInput(F4); - } +void matrix_init_kb(void){ + setPinOutput(F4); + writePinHigh(F4); +} - led_set_user(usb_led); +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if (res) { + // writePin sets the pin high for 1 and low for 0. + // In this example the pins are inverted, setting + // it low/0 turns it on, and high/1 turns the LED off. + // This behavior depends on whether the LED is between the pin + // and VCC or the pin and GND. + writePin(F4, !led_state.caps_lock); + } + return res; } -- cgit v1.2.3