Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keyboard] Add LED startup sequence to Lumberjack #19841

Merged
merged 1 commit into from
Feb 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions keyboards/peej/lumberjack/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)

};

void keyboard_pre_init_user() {
writePin(LED1, true);
writePin(LED2, true);
}

void keyboard_post_init_user() {
writePin(LED1, false);
writePin(LED2, false);
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
writePin(LED1, record->event.pressed);

return true;
}

layer_state_t layer_state_set_user(layer_state_t state) {
writePin(LED2, state);

return state;
}
13 changes: 4 additions & 9 deletions keyboards/peej/lumberjack/lumberjack.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@

#include "lumberjack.h"

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

return process_record_user(keycode, record);
}

layer_state_t layer_state_set_kb(layer_state_t state) {
writePin(LED2, state);

return layer_state_set_user(state);
keyboard_pre_init_user();
}