logo

qmk_firmware

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

kb16.c (1460B)


  1. /* Copyright 2022 DOIO
  2. * Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
  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 "quantum.h"
  18. // OLED animation
  19. #include "./lib/logo.h"
  20. // Default timeout for displaying boot logo.
  21. #ifndef OLED_LOGO_TIMEOUT
  22. #define OLED_LOGO_TIMEOUT 5000
  23. #endif
  24. #ifdef OLED_ENABLE
  25. uint16_t startup_timer;
  26. oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
  27. startup_timer = timer_read();
  28. return rotation;
  29. }
  30. bool oled_task_kb(void) {
  31. static bool finished_logo = false;
  32. if ((timer_elapsed(startup_timer) < OLED_LOGO_TIMEOUT) && !finished_logo) {
  33. render_logo();
  34. } else {
  35. finished_logo = true;
  36. if (!oled_task_user()) {
  37. return false;
  38. }
  39. }
  40. return true;
  41. }
  42. #endif