verd.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Copyright 2019 Andy Lee <alee@alittlepeacemusic.com>
  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. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #include "verd.h"
  16. // Optional override functions below.
  17. // You can leave any or all of these undefined.
  18. // These are only required if you want to perform custom actions.
  19. void matrix_init_kb(void) {
  20. // put your keyboard start-up code here
  21. // runs once when the firmware starts up
  22. matrix_init_user();
  23. led_init_ports();
  24. }
  25. void led_init_ports(void) {
  26. setPinOutput(C7);
  27. writePinHigh(C7);
  28. setPinOutput(E6);
  29. writePinHigh(E6);
  30. }
  31. bool led_update_kb(led_t led_state) {
  32. if (led_update_user(led_state)) {
  33. writePin(C7, !led_state.caps_lock);
  34. writePin(E6, !led_state.num_lock);
  35. }
  36. return true;
  37. }