logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

v1_3.c (1263B)


  1. /*
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. #include "quantum.h"
  14. // Optional override functions below.
  15. // You can leave any or all of these undefined.
  16. // These are only required if you want to perform custom actions.
  17. // For reference, visit https://docs.qmk.fm/#/custom_quantum_functions?id=layer-change-code
  18. // keyboard start-up codes
  19. // runs once when the firmware starts up
  20. void matrix_init_kb(void) {
  21. // Set the LEDs pins
  22. gpio_set_pin_output(D5); // Layer 1 Status LED
  23. matrix_init_user();
  24. }
  25. // Set LED based on layer
  26. __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
  27. gpio_write_pin(D5, layer_state_cmp(state, 1));
  28. return state;
  29. }