qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

mectechpad.c (924B)


      1 // Copyright 2025 Jack Sachinidhs (@jacksaxi)
      2 // SPDX-License-Identifier: GPL-2.0-or-later
      3 #include "quantum.h"
      4 
      5 void keyboard_post_init_kb(void) {
      6     // Initialize LED pins
      7     gpio_set_pin_output(LED_PIN_LAYER_0);
      8     gpio_write_pin_low(LED_PIN_LAYER_0);
      9     gpio_set_pin_output(LED_PIN_LAYER_1);
     10     gpio_write_pin_low(LED_PIN_LAYER_1);
     11     gpio_set_pin_output(LED_PIN_LAYER_2);
     12     gpio_write_pin_low(LED_PIN_LAYER_2);
     13     gpio_set_pin_output(LED_PIN_LAYER_3);
     14     gpio_write_pin_low(LED_PIN_LAYER_3);
     15 
     16     keyboard_post_init_user();
     17 }
     18 
     19 // Update LEDs based on the current layer
     20 void housekeeping_task_kb(void) {
     21     gpio_write_pin(LED_PIN_LAYER_0, (get_highest_layer(layer_state) == 0));
     22     gpio_write_pin(LED_PIN_LAYER_1, (get_highest_layer(layer_state) == 1));
     23     gpio_write_pin(LED_PIN_LAYER_2, (get_highest_layer(layer_state) == 2));
     24     gpio_write_pin(LED_PIN_LAYER_3, (get_highest_layer(layer_state) == 3));
     25 }