logo

qmk_firmware

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

meira.c (1414B)


  1. /* Copyright 2017 Cole Markham, WoodKeys.click
  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 "meira.h"
  17. void matrix_init_kb(void) {
  18. #ifdef WATCHDOG_ENABLE
  19. // This is done after turning the layer LED red, if we're caught in a loop
  20. // we should get a flashing red light
  21. wdt_enable(WDTO_500MS);
  22. #endif
  23. // put your keyboard start-up code here
  24. // runs once when the firmware starts up
  25. matrix_init_user();
  26. }
  27. void housekeeping_task_kb(void) {
  28. #ifdef WATCHDOG_ENABLE
  29. wdt_reset();
  30. #endif
  31. }
  32. bool shutdown_kb(bool jump_to_bootloader) {
  33. #ifdef WATCHDOG_ENABLE
  34. // Unconditionally run so shutdown_user can't mess up watchdog
  35. MCUSR = 0;
  36. wdt_disable();
  37. wdt_reset();
  38. #endif
  39. if (!shutdown_user(jump_to_bootloader)) {
  40. return false;
  41. }
  42. return true;
  43. }