logo

qmk_firmware

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

mariorion_v25.c (2117B)


  1. // Copyright <year> <name> <email> @<github_username>
  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. #include "quantum.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. gpio_set_pin_output(INDICATOR_0);
  23. gpio_set_pin_output(INDICATOR_1);
  24. gpio_set_pin_output(INDICATOR_2);
  25. matrix_init_user();
  26. }
  27. layer_state_t layer_state_set_kb(layer_state_t state) {
  28. switch (get_highest_layer(state)) {
  29. case 1:
  30. gpio_write_pin_high(INDICATOR_0);
  31. gpio_write_pin_low(INDICATOR_1);
  32. gpio_write_pin_low(INDICATOR_2);
  33. break;
  34. case 2:
  35. gpio_write_pin_low(INDICATOR_0);
  36. gpio_write_pin_high(INDICATOR_1);
  37. gpio_write_pin_low(INDICATOR_2);
  38. break;
  39. case 3:
  40. gpio_write_pin_low(INDICATOR_0);
  41. gpio_write_pin_low(INDICATOR_1);
  42. gpio_write_pin_high(INDICATOR_2);
  43. break;
  44. default:
  45. gpio_write_pin_high(INDICATOR_0);
  46. gpio_write_pin_high(INDICATOR_1);
  47. gpio_write_pin_high(INDICATOR_2);
  48. break;
  49. }
  50. return layer_state_set_user(state);
  51. }
  52. void suspend_power_down_kb(void) {
  53. gpio_write_pin_low(INDICATOR_0);
  54. gpio_write_pin_low(INDICATOR_1);
  55. gpio_write_pin_low(INDICATOR_2);
  56. suspend_power_down_user();
  57. }
  58. void suspend_wakeup_init_kb(void) {
  59. gpio_write_pin_high(INDICATOR_0);
  60. gpio_write_pin_high(INDICATOR_1);
  61. gpio_write_pin_high(INDICATOR_2);
  62. suspend_wakeup_init_user();
  63. }