lets_split.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "lets_split.h"
  2. #ifdef AUDIO_ENABLE
  3. float tone_startup[][2] = SONG(STARTUP_SOUND);
  4. float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
  5. #endif
  6. void matrix_init_kb(void) {
  7. #ifdef AUDIO_ENABLE
  8. _delay_ms(20); // gets rid of tick
  9. PLAY_NOTE_ARRAY(tone_startup, false, 0);
  10. #endif
  11. // // green led on
  12. // DDRD |= (1<<5);
  13. // PORTD &= ~(1<<5);
  14. // // orange led on
  15. // DDRB |= (1<<0);
  16. // PORTB &= ~(1<<0);
  17. matrix_init_user();
  18. };
  19. void promicro_bootloader_jmp(bool program) {
  20. #ifdef AUDIO_ENABLE
  21. PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
  22. _delay_ms(150);
  23. stop_all_notes();
  24. #endif
  25. uint16_t *const bootKeyPtr = (uint16_t *)0x0800;
  26. // Value used by Caterina bootloader use to determine whether to run the
  27. // sketch or the bootloader programmer.
  28. uint16_t bootKey = program ? 0x7777 : 0;
  29. *bootKeyPtr = bootKey;
  30. // setup watchdog timeout
  31. wdt_enable(WDTO_60MS);
  32. while(1) {} // wait for watchdog timer to trigger
  33. }