rev2.c 766 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "levinson.h"
  2. #ifdef AUDIO_ENABLE
  3. float tone_startup[][2] = SONG(STARTUP_SOUND);
  4. float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
  5. #endif
  6. #ifdef SSD1306OLED
  7. void led_set_kb(uint8_t usb_led) {
  8. // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
  9. led_set_user(usb_led);
  10. }
  11. #endif
  12. void matrix_init_kb(void) {
  13. #ifdef AUDIO_ENABLE
  14. _delay_ms(20); // gets rid of tick
  15. PLAY_SONG(tone_startup);
  16. #endif
  17. // // green led on
  18. // DDRD |= (1<<5);
  19. // PORTD &= ~(1<<5);
  20. // // orange led on
  21. // DDRB |= (1<<0);
  22. // PORTB &= ~(1<<0);
  23. matrix_init_user();
  24. };
  25. void shutdown_user(void) {
  26. #ifdef AUDIO_ENABLE
  27. PLAY_SONG(tone_goodbye);
  28. _delay_ms(150);
  29. stop_all_notes();
  30. #endif
  31. }