Debug LEDs and Buzzer on start.

master
q3k 2013-09-15 13:24:54 +02:00
parent b373d816c2
commit ed90fe1244
3 changed files with 20 additions and 11 deletions

View File

@ -8,7 +8,7 @@ OPTIMIZE = -Os
DEFS =
LIBS =
HZ = 20000000
HZ = 2000000
# You should not have to change anything below here.

View File

@ -1,7 +1,9 @@
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "io.h"
#include "buzzer.h"
IMPORT_IO(BUZZER);
@ -36,3 +38,14 @@ ISR(TIMER1_COMPA_vect)
{
IO_TOGGLE(BUZZER);
}
void buzzer_signal_boot(void)
{
buzzer_start(TONE_LOW);
_delay_ms(100);
buzzer_start(TONE_MID);
_delay_ms(100);
buzzer_start(TONE_HIGH);
_delay_ms(100);
buzzer_stop();
}

View File

@ -35,19 +35,15 @@ int main (void)
IO_SET_OUTPUT(LED_RED);
IO_SET_OUTPUT(LED_GREEN);
IO_OUT(LED_GREEN, 1);
IO_OUT(LED_RED, 1);
buzzer_init();
sei();
buzzer_start(TONE_LOW);
_delay_ms(10);
buzzer_start(TONE_MID);
_delay_ms(10);
buzzer_start(TONE_HIGH);
_delay_ms(10);
buzzer_stop();
// Flash LEDs and buzz buzzer for debug
IO_OUT(LED_GREEN, 1);
IO_OUT(LED_RED, 1);
buzzer_signal_boot();
IO_OUT(LED_GREEN, 0);
IO_OUT(LED_RED, 0);
for (;;) {}
return 0;