aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/led.c12
-rw-r--r--quantum/template/template.c32
-rw-r--r--quantum/template/template.h1
3 files changed, 36 insertions, 9 deletions
diff --git a/quantum/led.c b/quantum/led.c
index 2c0574660..a53e94043 100644
--- a/quantum/led.c
+++ b/quantum/led.c
@@ -16,9 +16,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#include <avr/io.h> 18#include <avr/io.h>
19#include "stdint.h" 19#include <stddef.h>
20#include "led.h" 20#include "led.h"
21 21
22__attribute__ ((weak))
23void * led_set_kb(uint8_t usb_led) {
24 return NULL;
25};
22 26
23void led_set(uint8_t usb_led) 27void led_set(uint8_t usb_led)
24{ 28{
@@ -35,4 +39,10 @@ void led_set(uint8_t usb_led)
35 // DDRE &= ~(1<<6); 39 // DDRE &= ~(1<<6);
36 // PORTE &= ~(1<<6); 40 // PORTE &= ~(1<<6);
37 // } 41 // }
42
43 if (led_set_kb) {
44 (*led_set_kb)(usb_led);
45 }
46
47 return;
38} 48}
diff --git a/quantum/template/template.c b/quantum/template/template.c
index 7dcd67cfc..828afb18c 100644
--- a/quantum/template/template.c
+++ b/quantum/template/template.c
@@ -2,22 +2,38 @@
2 2
3__attribute__ ((weak)) 3__attribute__ ((weak))
4void matrix_init_user(void) { 4void matrix_init_user(void) {
5 // leave these blank 5 // leave this function blank - it can be defined in a keymap file
6} 6 return NULL;
7};
7 8
8__attribute__ ((weak)) 9__attribute__ ((weak))
9void matrix_scan_user(void) { 10void matrix_scan_user(void) {
10 // leave these blank 11 // leave this function blank - it can be defined in a keymap file
11} 12 return NULL;
13};
14
15__attribute__ ((weak))
16void led_set_user(uint8_t usb_led) {
17 // leave this function blank - it can be defined in a keymap file
18 return NULL;
19};
12 20
13void matrix_init_kb(void) { 21void matrix_init_kb(void) {
14 // put your keyboard start-up code here 22 // put your keyboard start-up code here
15 // runs once when the firmware starts up 23 // runs once when the firmware starts up
24
16 matrix_init_user(); 25 matrix_init_user();
17} 26};
18 27
19void matrix_scan_kb(void) { 28void matrix_scan_kb(void) {
20 // put your looping keyboard code here 29 // put your looping keyboard code here
21 // runs every cycle (a lot) 30 // runs every cycle (a lot)
31
22 matrix_scan_user(); 32 matrix_scan_user();
23} \ No newline at end of file 33};
34
35void led_set_kb(uint8_t usb_led) {
36 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
37
38 led_set_user(usb_led);
39}; \ No newline at end of file
diff --git a/quantum/template/template.h b/quantum/template/template.h
index 1171dc8e0..ba91abac3 100644
--- a/quantum/template/template.h
+++ b/quantum/template/template.h
@@ -21,5 +21,6 @@
21 21
22void matrix_init_user(void); 22void matrix_init_user(void);
23void matrix_scan_user(void); 23void matrix_scan_user(void);
24void led_set_user(uint8_t usb_led);
24 25
25#endif \ No newline at end of file 26#endif \ No newline at end of file