virgo.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Copyright 2019 MechMerlin
  2. * Edits etc 2020 Flexerm
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #include "virgo.h"
  18. void matrix_init_kb(void) {
  19. // put your keyboard start-up code here
  20. // runs once when the firmware starts up
  21. setPinOutput(E6);
  22. setPinOutput(B2);
  23. matrix_init_user();
  24. }
  25. void matrix_scan_kb(void) {
  26. // put your looping keyboard code here
  27. // runs every cycle (a lot)
  28. matrix_scan_user();
  29. }
  30. bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  31. // put your per-action keyboard code here
  32. // runs for every action, just before processing by the firmware
  33. return process_record_user(keycode, record);
  34. }
  35. bool led_update_kb(led_t led_state) {
  36. if(led_update_user(led_state)) {
  37. writePin(E6, !led_state.caps_lock);
  38. writePin(B2, !led_state.scroll_lock);
  39. }
  40. return true;
  41. }