aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-11-08 22:31:16 +0000
committerGitHub <noreply@github.com>2020-11-08 22:31:16 +0000
commit1ff5ee255fadcd6bfc4defb68ef097d67ebd40ad (patch)
tree559d771e6c2490ea7816b095b0e6e9a196462ec0
parent9cd3ffa5ba1187c0bc11b613078d89b503dcf419 (diff)
downloadqmk_firmware-1ff5ee255fadcd6bfc4defb68ef097d67ebd40ad.tar.gz
qmk_firmware-1ff5ee255fadcd6bfc4defb68ef097d67ebd40ad.zip
Indicator LEDs as config (#10816)
* First pass * Add config options to docs * Update some wording * Slight tidy up of backlight caps logic * Init pin to correct state * Move init location * Reverse default state
-rw-r--r--common_features.mk1
-rw-r--r--docs/_summary.md1
-rw-r--r--docs/custom_quantum_functions.md102
-rw-r--r--docs/feature_led_indicators.md116
-rw-r--r--keyboards/cospad/config.h3
-rw-r--r--keyboards/cospad/cospad.c16
-rw-r--r--quantum/led.c137
-rw-r--r--quantum/quantum.c56
-rw-r--r--tmk_core/common/led.h6
9 files changed, 264 insertions, 174 deletions
diff --git a/common_features.mk b/common_features.mk
index 5f232d5f0..ba66c5324 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -17,6 +17,7 @@ SERIAL_PATH := $(QUANTUM_PATH)/serial_link
17 17
18QUANTUM_SRC += \ 18QUANTUM_SRC += \
19 $(QUANTUM_DIR)/quantum.c \ 19 $(QUANTUM_DIR)/quantum.c \
20 $(QUANTUM_DIR)/led.c \
20 $(QUANTUM_DIR)/keymap_common.c \ 21 $(QUANTUM_DIR)/keymap_common.c \
21 $(QUANTUM_DIR)/keycode_config.c 22 $(QUANTUM_DIR)/keycode_config.c
22 23
diff --git a/docs/_summary.md b/docs/_summary.md
index 2e874fb1c..44030d812 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -105,6 +105,7 @@
105 * [Encoders](feature_encoders.md) 105 * [Encoders](feature_encoders.md)
106 * [Haptic Feedback](feature_haptic_feedback.md) 106 * [Haptic Feedback](feature_haptic_feedback.md)
107 * [Joystick](feature_joystick.md) 107 * [Joystick](feature_joystick.md)
108 * [LED Indicators](feature_led_indicators.md)
108 * [Proton C Conversion](proton_c_conversion.md) 109 * [Proton C Conversion](proton_c_conversion.md)
109 * [PS/2 Mouse](feature_ps2_mouse.md) 110 * [PS/2 Mouse](feature_ps2_mouse.md)
110 * [Split Keyboard](feature_split_keyboard.md) 111 * [Split Keyboard](feature_split_keyboard.md)
diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md
index bf3a60377..a459042b3 100644
--- a/docs/custom_quantum_functions.md
+++ b/docs/custom_quantum_functions.md
@@ -88,108 +88,6 @@ keyrecord_t record {
88} 88}
89``` 89```
90 90
91# LED Control
92
93QMK provides methods to read 5 of the LEDs defined in the HID spec:
94
95* Num Lock
96* Caps Lock
97* Scroll Lock
98* Compose
99* Kana
100
101There are two ways to get the lock LED state:
102
103* by implementing `bool led_update_kb(led_t led_state)` or `_user(led_t led_state)`; or
104* by calling `led_t host_keyboard_led_state()`
105
106!> `host_keyboard_led_state()` may already reflect a new value before `led_update_user()` is called.
107
108Two more deprecated functions exist that provide the LED state as a `uint8_t`:
109
110* `uint8_t led_set_kb(uint8_t usb_led)` and `_user(uint8_t usb_led)`
111* `uint8_t host_keyboard_leds()`
112
113## `led_update_user()`
114
115This function will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.
116
117By convention, return `true` from `led_update_user()` to get the `led_update_kb()` hook to run its code, and
118return `false` when you would prefer not to run the code in `led_update_kb()`.
119
120Some examples include:
121
122 - overriding the LEDs to use them for something else like layer indication
123 - return `false` because you do not want the `_kb()` function to run, as it would override your layer behavior.
124 - play a sound when an LED turns on or off.
125 - return `true` because you want the `_kb` function to run, and this is in addition to the default LED behavior.
126
127?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.
128
129### Example `led_update_kb()` Implementation
130
131```c
132bool led_update_kb(led_t led_state) {
133 bool res = led_update_user(led_state);
134 if(res) {
135 // writePin sets the pin high for 1 and low for 0.
136 // In this example the pins are inverted, setting
137 // it low/0 turns it on, and high/1 turns the LED off.
138 // This behavior depends on whether the LED is between the pin
139 // and VCC or the pin and GND.
140 writePin(B0, !led_state.num_lock);
141 writePin(B1, !led_state.caps_lock);
142 writePin(B2, !led_state.scroll_lock);
143 writePin(B3, !led_state.compose);
144 writePin(B4, !led_state.kana);
145 }
146 return res;
147}
148```
149
150### Example `led_update_user()` Implementation
151
152This incomplete example would play a sound if Caps Lock is turned on or off. It returns `true`, because you also want the LEDs to maintain their state.
153
154```c
155#ifdef AUDIO_ENABLE
156 float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
157 float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
158#endif
159
160bool led_update_user(led_t led_state) {
161 #ifdef AUDIO_ENABLE
162 static uint8_t caps_state = 0;
163 if (caps_state != led_state.caps_lock) {
164 led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off);
165 caps_state = led_state.caps_lock;
166 }
167 #endif
168 return true;
169}
170```
171
172### `led_update_*` Function Documentation
173
174* Keyboard/Revision: `bool led_update_kb(led_t led_state)`
175* Keymap: `bool led_update_user(led_t led_state)`
176
177## `host_keyboard_led_state()`
178
179Call this function to get the last received LED state as a `led_t`. This is useful for reading the LED state outside `led_update_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).
180
181## Setting Physical LED State
182
183Some keyboard implementations provide convenience methods for setting the state of the physical LEDs.
184
185### Ergodox Boards
186
187The Ergodox implementations provide `ergodox_right_led_1`/`2`/`3_on`/`off()` to turn individual LEDs on or off, as well as `ergodox_right_led_on`/`off(uint8_t led)` to turn them on or off by their index.
188
189In addition, it is possible to specify the brightness level of all LEDs with `ergodox_led_all_set(uint8_t n)`; of individual LEDs with `ergodox_right_led_1`/`2`/`3_set(uint8_t n)`; or by index with `ergodox_right_led_set(uint8_t led, uint8_t n)`.
190
191Ergodox boards also define `LED_BRIGHTNESS_LO` for the lowest brightness and `LED_BRIGHTNESS_HI` for the highest brightness (which is the default).
192
193# Keyboard Initialization Code 91# Keyboard Initialization Code
194 92
195There are several steps in the keyboard initialization process. Depending on what you want to do, it will influence which function you should use. 93There are several steps in the keyboard initialization process. Depending on what you want to do, it will influence which function you should use.
diff --git a/docs/feature_led_indicators.md b/docs/feature_led_indicators.md
new file mode 100644
index 000000000..10e095ab1
--- /dev/null
+++ b/docs/feature_led_indicators.md
@@ -0,0 +1,116 @@
1# LED Indicators
2
3QMK provides methods to read 5 of the LEDs defined in the HID spec:
4
5* Num Lock
6* Caps Lock
7* Scroll Lock
8* Compose
9* Kana
10
11There are three ways to get the lock LED state:
12* by specifying configuration options within `config.h`
13* by implementing `bool led_update_kb(led_t led_state)` or `_user(led_t led_state)`; or
14* by calling `led_t host_keyboard_led_state()`
15
16!> `host_keyboard_led_state()` may already reflect a new value before `led_update_user()` is called.
17
18Two more deprecated functions exist that provide the LED state as a `uint8_t`:
19
20* `uint8_t led_set_kb(uint8_t usb_led)` and `_user(uint8_t usb_led)`
21* `uint8_t host_keyboard_leds()`
22
23## Configuration Options
24
25To configure the indicators, `#define` these in your `config.h`:
26
27|Define |Default |Description |
28|---------------------|-------------|-------------------------------------------|
29|`LED_NUM_LOCK_PIN` |*Not defined*|The pin that controls the `Num Lock` LED |
30|`LED_CAPS_LOCK_PIN` |*Not defined*|The pin that controls the `Caps Lock` LED |
31|`LED_SCROLL_LOCK_PIN`|*Not defined*|The pin that controls the `Scroll Lock` LED|
32|`LED_COMPOSE_PIN` |*Not defined*|The pin that controls the `Compose` LED |
33|`LED_KANA_PIN` |*Not defined*|The pin that controls the `Kana` LED |
34|`LED_PIN_ON_STATE` |`1` |The state of the indicator pins when the LED is "on" - `1` for high, `0` for low|
35
36Unless you are designing your own keyboard, you generally should not need to change the above config options.
37
38## `led_update_*()`
39
40When the configuration options do not provide enough flexibility, the API hooks provided allow custom control of the LED behavior. These functions will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.
41
42By convention, return `true` from `led_update_user()` to get the `led_update_kb()` hook to run its code, and
43return `false` when you would prefer not to run the code in `led_update_kb()`.
44
45Some examples include:
46
47 - overriding the LEDs to use them for something else like layer indication
48 - return `false` because you do not want the `_kb()` function to run, as it would override your layer behavior.
49 - play a sound when an LED turns on or off.
50 - return `true` because you want the `_kb` function to run, and this is in addition to the default LED behavior.
51
52?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.
53
54### Example `led_update_kb()` Implementation
55
56```c
57bool led_update_kb(led_t led_state) {
58 bool res = led_update_user(led_state);
59 if(res) {
60 // writePin sets the pin high for 1 and low for 0.
61 // In this example the pins are inverted, setting
62 // it low/0 turns it on, and high/1 turns the LED off.
63 // This behavior depends on whether the LED is between the pin
64 // and VCC or the pin and GND.
65 writePin(B0, !led_state.num_lock);
66 writePin(B1, !led_state.caps_lock);
67 writePin(B2, !led_state.scroll_lock);
68 writePin(B3, !led_state.compose);
69 writePin(B4, !led_state.kana);
70 }
71 return res;
72}
73```
74
75### Example `led_update_user()` Implementation
76
77This incomplete example would play a sound if Caps Lock is turned on or off. It returns `true`, because you also want the LEDs to maintain their state.
78
79```c
80#ifdef AUDIO_ENABLE
81 float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
82 float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
83#endif
84
85bool led_update_user(led_t led_state) {
86 #ifdef AUDIO_ENABLE
87 static uint8_t caps_state = 0;
88 if (caps_state != led_state.caps_lock) {
89 led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off);
90 caps_state = led_state.caps_lock;
91 }
92 #endif
93 return true;
94}
95```
96
97### `led_update_*` Function Documentation
98
99* Keyboard/Revision: `bool led_update_kb(led_t led_state)`
100* Keymap: `bool led_update_user(led_t led_state)`
101
102## `host_keyboard_led_state()`
103
104Call this function to get the last received LED state as a `led_t`. This is useful for reading the LED state outside `led_update_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).
105
106## Setting Physical LED State
107
108Some keyboard implementations provide convenience methods for setting the state of the physical LEDs.
109
110### Ergodox Boards
111
112The Ergodox implementations provide `ergodox_right_led_1`/`2`/`3_on`/`off()` to turn individual LEDs on or off, as well as `ergodox_right_led_on`/`off(uint8_t led)` to turn them on or off by their index.
113
114In addition, it is possible to specify the brightness level of all LEDs with `ergodox_led_all_set(uint8_t n)`; of individual LEDs with `ergodox_right_led_1`/`2`/`3_set(uint8_t n)`; or by index with `ergodox_right_led_set(uint8_t led, uint8_t n)`.
115
116Ergodox boards also define `LED_BRIGHTNESS_LO` for the lowest brightness and `LED_BRIGHTNESS_HI` for the highest brightness (which is the default).
diff --git a/keyboards/cospad/config.h b/keyboards/cospad/config.h
index 8d2994b7b..648fa29a6 100644
--- a/keyboards/cospad/config.h
+++ b/keyboards/cospad/config.h
@@ -53,6 +53,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
53 */ 53 */
54#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 54#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
55 55
56#define LED_NUM_LOCK_PIN B2
57#define LED_PIN_ON_STATE 0
58
56#define BACKLIGHT_PIN F7 59#define BACKLIGHT_PIN F7
57// #define BACKLIGHT_BREATHING 60// #define BACKLIGHT_BREATHING
58#define BACKLIGHT_LEVELS 3 61#define BACKLIGHT_LEVELS 3
diff --git a/keyboards/cospad/cospad.c b/keyboards/cospad/cospad.c
index c1f3a7047..e7772f290 100644
--- a/keyboards/cospad/cospad.c
+++ b/keyboards/cospad/cospad.c
@@ -14,19 +14,3 @@
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 "cospad.h" 16#include "cospad.h"
17
18void keyboard_pre_init_kb(void) {
19 led_init_ports();
20 keyboard_pre_init_user();
21}
22
23void led_init_ports(void) {
24 setPinOutput(B2);
25}
26
27bool led_update_kb(led_t led_state) {
28 if (led_update_user(led_state)) {
29 writePin(B2, !led_state.num_lock);
30 }
31 return true;
32}
diff --git a/quantum/led.c b/quantum/led.c
new file mode 100644
index 000000000..3e30b1a5a
--- /dev/null
+++ b/quantum/led.c
@@ -0,0 +1,137 @@
1/* Copyright 2020 zvecr<git@zvecr.com>
2 *
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
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
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/>.
15 */
16#include "quantum.h"
17
18#ifdef BACKLIGHT_ENABLE
19# include "backlight.h"
20extern backlight_config_t backlight_config;
21#else
22// Cannot use BACKLIGHT_CAPS_LOCK without backlight being enabled
23# undef BACKLIGHT_CAPS_LOCK
24#endif
25
26#ifndef LED_PIN_ON_STATE
27# define LED_PIN_ON_STATE 1
28#endif
29
30#if defined(BACKLIGHT_CAPS_LOCK)
31/** \brief Caps Lock indicator using backlight (for keyboards without dedicated LED)
32 */
33static void handle_backlight_caps_lock(led_t led_state) {
34 // Use backlight as Caps Lock indicator
35 uint8_t bl_toggle_lvl = 0;
36
37 if (led_state.caps_lock && !backlight_config.enable) {
38 // Turning Caps Lock ON and backlight is disabled in config
39 // Toggling backlight to the brightest level
40 bl_toggle_lvl = BACKLIGHT_LEVELS;
41 } else if (!led_state.caps_lock && backlight_config.enable) {
42 // Turning Caps Lock OFF and backlight is enabled in config
43 // Toggling backlight and restoring config level
44 bl_toggle_lvl = backlight_config.level;
45 }
46
47 // Set level without modify backlight_config to keep ability to restore state
48 backlight_set(bl_toggle_lvl);
49}
50#endif
51
52/** \brief Lock LED set callback - keymap/user level
53 *
54 * \deprecated Use led_update_user() instead.
55 */
56__attribute__((weak)) void led_set_user(uint8_t usb_led) {}
57
58/** \brief Lock LED set callback - keyboard level
59 *
60 * \deprecated Use led_update_kb() instead.
61 */
62__attribute__((weak)) void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); }
63
64/** \brief Lock LED update callback - keymap/user level
65 *
66 * \return True if led_update_kb() should run its own code, false otherwise.
67 */
68__attribute__((weak)) bool led_update_user(led_t led_state) { return true; }
69
70/** \brief Lock LED update callback - keyboard level
71 *
72 * \return Ignored for now.
73 */
74__attribute__((weak)) bool led_update_kb(led_t led_state) {
75 bool res = led_update_user(led_state);
76 if (res) {
77#if defined(LED_NUM_LOCK_PIN) || defined(LED_CAPS_LOCK_PIN) || defined(LED_SCROLL_LOCK_PIN) || defined(LED_COMPOSE_PIN) || defined(LED_KANA_PIN)
78# if LED_PIN_ON_STATE == 0
79 // invert the whole thing to avoid having to conditionally !led_state.x later
80 led_state.raw = ~led_state.raw;
81# endif
82
83# ifdef LED_NUM_LOCK_PIN
84 writePin(LED_NUM_LOCK_PIN, led_state.num_lock);
85# endif
86# ifdef LED_CAPS_LOCK_PIN
87 writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
88# endif
89# ifdef LED_SCROLL_LOCK_PIN
90 writePin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock);
91# endif
92# ifdef LED_COMPOSE_PIN
93 writePin(LED_COMPOSE_PIN, led_state.compose);
94# endif
95# ifdef LED_KANA_PIN
96 writePin(LED_KANA_PIN, led_state.kana);
97# endif
98#endif
99 }
100 return res;
101}
102
103/** \brief Initialise any LED related hardware and/or state
104 */
105__attribute__((weak)) void led_init_ports(void) {
106#ifdef LED_NUM_LOCK_PIN
107 setPinOutput(LED_NUM_LOCK_PIN);
108 writePin(LED_NUM_LOCK_PIN, !LED_PIN_ON_STATE);
109#endif
110#ifdef LED_CAPS_LOCK_PIN
111 setPinOutput(LED_CAPS_LOCK_PIN);
112 writePin(LED_CAPS_LOCK_PIN, !LED_PIN_ON_STATE);
113#endif
114#ifdef LED_SCROLL_LOCK_PIN
115 setPinOutput(LED_SCROLL_LOCK_PIN);
116 writePin(LED_SCROLL_LOCK_PIN, !LED_PIN_ON_STATE);
117#endif
118#ifdef LED_COMPOSE_PIN
119 setPinOutput(LED_COMPOSE_PIN);
120 writePin(LED_COMPOSE_PIN, !LED_PIN_ON_STATE);
121#endif
122#ifdef LED_KANA_PIN
123 setPinOutput(LED_KANA_PIN);
124 writePin(LED_KANA_PIN, !LED_PIN_ON_STATE);
125#endif
126}
127
128/** \brief Entrypoint for protocol to LED binding
129 */
130__attribute__((weak)) void led_set(uint8_t usb_led) {
131#ifdef BACKLIGHT_CAPS_LOCK
132 handle_backlight_caps_lock((led_t)usb_led);
133#endif
134
135 led_set_kb(usb_led);
136 led_update_kb((led_t)usb_led);
137} \ No newline at end of file
diff --git a/quantum/quantum.c b/quantum/quantum.c
index dab6c9172..0b2f98762 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -23,7 +23,6 @@
23 23
24#ifdef BACKLIGHT_ENABLE 24#ifdef BACKLIGHT_ENABLE
25# include "backlight.h" 25# include "backlight.h"
26extern backlight_config_t backlight_config;
27#endif 26#endif
28 27
29#ifdef FAUXCLICKY_ENABLE 28#ifdef FAUXCLICKY_ENABLE
@@ -602,6 +601,10 @@ void matrix_init_quantum() {
602 if (!eeconfig_is_enabled()) { 601 if (!eeconfig_is_enabled()) {
603 eeconfig_init(); 602 eeconfig_init();
604 } 603 }
604#if defined(LED_NUM_LOCK_PIN) || defined(LED_CAPS_LOCK_PIN) || defined(LED_SCROLL_LOCK_PIN) || defined(LED_COMPOSE_PIN) || defined(LED_KANA_PIN)
605 // TODO: remove calls to led_init_ports from keyboards and remove ifdef
606 led_init_ports();
607#endif
605#ifdef BACKLIGHT_ENABLE 608#ifdef BACKLIGHT_ENABLE
606# ifdef LED_MATRIX_ENABLE 609# ifdef LED_MATRIX_ENABLE
607 led_matrix_init(); 610 led_matrix_init();
@@ -725,55 +728,6 @@ void api_send_unicode(uint32_t unicode) {
725#endif 728#endif
726} 729}
727 730
728/** \brief Lock LED set callback - keymap/user level
729 *
730 * \deprecated Use led_update_user() instead.
731 */
732__attribute__((weak)) void led_set_user(uint8_t usb_led) {}
733
734/** \brief Lock LED set callback - keyboard level
735 *
736 * \deprecated Use led_update_kb() instead.
737 */
738__attribute__((weak)) void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); }
739
740/** \brief Lock LED update callback - keymap/user level
741 *
742 * \return True if led_update_kb() should run its own code, false otherwise.
743 */
744__attribute__((weak)) bool led_update_user(led_t led_state) { return true; }
745
746/** \brief Lock LED update callback - keyboard level
747 *
748 * \return Ignored for now.
749 */
750__attribute__((weak)) bool led_update_kb(led_t led_state) { return led_update_user(led_state); }
751
752__attribute__((weak)) void led_init_ports(void) {}
753
754__attribute__((weak)) void led_set(uint8_t usb_led) {
755#if defined(BACKLIGHT_CAPS_LOCK) && defined(BACKLIGHT_ENABLE)
756 // Use backlight as Caps Lock indicator
757 uint8_t bl_toggle_lvl = 0;
758
759 if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK) && !backlight_config.enable) {
760 // Turning Caps Lock ON and backlight is disabled in config
761 // Toggling backlight to the brightest level
762 bl_toggle_lvl = BACKLIGHT_LEVELS;
763 } else if (IS_LED_OFF(usb_led, USB_LED_CAPS_LOCK) && backlight_config.enable) {
764 // Turning Caps Lock OFF and backlight is enabled in config
765 // Toggling backlight and restoring config level
766 bl_toggle_lvl = backlight_config.level;
767 }
768
769 // Set level without modify backlight_config to keep ability to restore state
770 backlight_set(bl_toggle_lvl);
771#endif
772
773 led_set_kb(usb_led);
774 led_update_kb((led_t)usb_led);
775}
776
777//------------------------------------------------------------------------------ 731//------------------------------------------------------------------------------
778// Override these functions in your keymap file to play different tunes on 732// Override these functions in your keymap file to play different tunes on
779// different events such as startup and bootloader jump 733// different events such as startup and bootloader jump
@@ -781,5 +735,3 @@ __attribute__((weak)) void led_set(uint8_t usb_led) {
781__attribute__((weak)) void startup_user() {} 735__attribute__((weak)) void startup_user() {}
782 736
783__attribute__((weak)) void shutdown_user() {} 737__attribute__((weak)) void shutdown_user() {}
784
785//------------------------------------------------------------------------------
diff --git a/tmk_core/common/led.h b/tmk_core/common/led.h
index 990282862..81c664d60 100644
--- a/tmk_core/common/led.h
+++ b/tmk_core/common/led.h
@@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef LED_H 18#pragma once
19#define LED_H 19
20#include "stdint.h" 20#include "stdint.h"
21#include "stdbool.h" 21#include "stdbool.h"
22 22
@@ -52,5 +52,3 @@ void led_init_ports(void);
52#ifdef __cplusplus 52#ifdef __cplusplus
53} 53}
54#endif 54#endif
55
56#endif