Revision 857
Removed KWoo's crap from template.
main.c | ||
---|---|---|
1 | 1 |
#include <dragonfly_lib.h> |
2 | 2 |
|
3 |
volatile int seconds; |
|
4 |
volatile int minutes; |
|
5 |
volatile int hours; |
|
6 |
volatile char horn; |
|
7 |
|
|
8 |
void time_function(void) { |
|
9 |
if (minutes == 59 && seconds == 59) { |
|
10 |
hours++; |
|
11 |
minutes = 0; |
|
12 |
seconds = 0; |
|
13 |
|
|
14 |
} else if (seconds == 59) { |
|
15 |
minutes++; |
|
16 |
seconds = 0; |
|
17 |
horn = 1; |
|
18 |
} else { |
|
19 |
seconds++; |
|
20 |
} |
|
21 |
} |
|
22 |
|
|
23 |
int main(void) { |
|
24 |
int old_secs; |
|
25 |
seconds = 0; |
|
26 |
minutes = 0; |
|
27 |
hours = 0; |
|
28 |
horn = 0; |
|
29 |
|
|
30 |
DDRF = 0x01; |
|
31 |
PORTF = 0x00; |
|
32 |
|
|
33 |
rtc_init(SECOND, time_function); |
|
34 |
|
|
35 |
while(1) { |
|
36 |
if (horn == 1) { |
|
37 |
horn = 0; |
|
38 |
old_secs = seconds; |
|
39 |
|
|
40 |
while (seconds < 5) { |
|
41 |
PORTF = 0x01; |
|
42 |
} |
|
43 |
|
|
44 |
PORTF = 0x00; |
|
45 |
} |
|
46 |
} |
|
47 |
range_init(); |
|
48 |
//orb_enable(); |
|
49 |
usb_puts("Turned on!\n"); |
|
3 |
int main(void) |
|
4 |
{ |
|
5 |
dragonfly_init(ALL_ON); |
|
50 | 6 |
return 0; |
51 | 7 |
} |
52 | 8 |
|
Also available in: Unified diff