mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-23 20:03:01 +00:00
e62ab7e259
* f * Allow overriding of all functions in wonderland.c - needed for custom LED functions in keymap.c * Example of layer indication via LEDs optimize * Use newer led_update_kb and led_update_user hooks - these allow overriding without use of __attribute((weak))__ * Update led documentation a bit - clarify some of the wording around how to use led_update_user * Update led_update_user example * Update audio example to be complete * trailing spaces smh * spaces * spaces * smh * Less code is good * Update docs/custom_quantum_functions.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update docs/custom_quantum_functions.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update docs/custom_quantum_functions.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update docs/custom_quantum_functions.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update docs/custom_quantum_functions.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update docs/custom_quantum_functions.md Co-Authored-By: fauxpark <fauxpark@gmail.com>
35 lines
772 B
C
Executable File
35 lines
772 B
C
Executable File
#include "wonderland.h"
|
|
|
|
__attribute__ ((weak))
|
|
void matrix_init_kb(void) {
|
|
// put your keyboard start-up code here
|
|
// runs once when the firmware starts up
|
|
matrix_init_user();
|
|
led_init_ports();
|
|
};
|
|
|
|
__attribute__ ((weak))
|
|
void matrix_scan_kb(void) {
|
|
// put your looping keyboard code here
|
|
// runs every cycle (a lot)
|
|
matrix_scan_user();
|
|
};
|
|
|
|
__attribute__ ((weak))
|
|
void led_init_ports(void) {
|
|
// * Set our LED pins as output
|
|
setPinOutput(B1);
|
|
setPinOutput(B2);
|
|
setPinOutput(B3);
|
|
}
|
|
|
|
bool led_update_kb(led_t led_state) {
|
|
bool runDefault = led_update_user(led_state);
|
|
if (runDefault) {
|
|
writePin(B1, !led_state.num_lock);
|
|
writePin(B2, !led_state.caps_lock);
|
|
writePin(B3, !led_state.scroll_lock);
|
|
}
|
|
return runDefault;
|
|
}
|