Skip to content

Commit 59f5889

Browse files
authored
[Keyboard] Add LED startup sequence to Lumberjack (#19841)
1 parent 7b5dee4 commit 59f5889

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

keyboards/peej/lumberjack/keymaps/via/keymap.c

+22
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4848
)
4949

5050
};
51+
52+
void keyboard_pre_init_user() {
53+
writePin(LED1, true);
54+
writePin(LED2, true);
55+
}
56+
57+
void keyboard_post_init_user() {
58+
writePin(LED1, false);
59+
writePin(LED2, false);
60+
}
61+
62+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
63+
writePin(LED1, record->event.pressed);
64+
65+
return true;
66+
}
67+
68+
layer_state_t layer_state_set_user(layer_state_t state) {
69+
writePin(LED2, state);
70+
71+
return state;
72+
}

keyboards/peej/lumberjack/lumberjack.c

+4-9
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@
1616

1717
#include "lumberjack.h"
1818

19-
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
20-
writePin(LED1, record->event.pressed);
19+
void keyboard_pre_init_kb() {
20+
setPinOutput(LED1);
21+
setPinOutput(LED2);
2122

22-
return process_record_user(keycode, record);
23-
}
24-
25-
layer_state_t layer_state_set_kb(layer_state_t state) {
26-
writePin(LED2, state);
27-
28-
return layer_state_set_user(state);
23+
keyboard_pre_init_user();
2924
}

0 commit comments

Comments
 (0)