2
0

keymap.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Copyright 2018 Holten Campbell
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include QMK_KEYBOARD_H
  17. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  18. LAYOUT(
  19. KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC,
  20. KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT,
  21. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
  22. KC_LCTL, KC_LALT, KC_RBRC, MO(1), KC_SPC, KC_MINS, KC_LGUI, TO(1)
  23. )
  24. };
  25. void matrix_init_user(void) {
  26. // set CapsLock LED to output and low
  27. setPinOutput(B1);
  28. writePinHigh(B1);
  29. // set NumLock LED to output and low
  30. setPinOutput(B2);
  31. writePinHigh(B2);
  32. // set ScrollLock LED to output and low
  33. setPinOutput(B3);
  34. writePinHigh(B3);
  35. }
  36. void matrix_scan_user(void) {
  37. }
  38. void led_set_user(uint8_t usb_led) {
  39. if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
  40. writePinLow(B2);
  41. } else {
  42. writePinHigh(B2);
  43. }
  44. if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
  45. writePinLow(B1);
  46. } else {
  47. writePinHigh(B1);
  48. }
  49. /*
  50. if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
  51. writePinLow(B3);
  52. } else {
  53. writePinHigh(B3);
  54. }*/
  55. }
  56. //function for layer indicator LED
  57. uint32_t layer_state_set_user(uint32_t state)
  58. {
  59. if (biton32(state) == 1) {
  60. writePinLow(B3);
  61. } else {
  62. writePinHigh(B3);
  63. }
  64. return state;
  65. }