Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 61 lines (40 sloc) 1.02 kb
5705581 Vitja Makarov Add new main()
authored
1 #include <avr/io.h>
2 #include <avr/interrupt.h>
3 #include <util/delay.h>
4
5 #include "timer.h"
6 #include "uart.h"
7 #include "at45.h"
13fab9f Vitja Makarov uart-loader: initial
authored
8 #include "loader.h"
4ad01d8 Vitja Makarov Move power stuff to power.h
authored
9 #include "power.h"
10
5705581 Vitja Makarov Add new main()
authored
11
12
13
14
15
16 int main()
17 {
18 DDRC = 0xff; /* speaker */
19 //DDRA = (1 << PA3);
20 //DDRB = (1 << PB6);
21 DDRG = (1 << PG1) ; /* ring */
22 DDRE = ((1 << PE2) | /* LED */
4ad01d8 Vitja Makarov Move power stuff to power.h
authored
23 (1 << PE7)); /* Speaker and Flash Power */
5705581 Vitja Makarov Add new main()
authored
24 DDRB &= ~((1 << PB4) | /* COM on */
25 (1 << PB5)); /* HANG */
26
27 //DDRD &= ~((1 << PD2) | (1 << PD3)); // hang
28
29 //PB5, PB6 - HANG
30
31 PORTE &= ~(1 << PE7);
32
33 timer_init();
34 timer_enable();
35
36
37 unsigned short oldsecs = 0;
38
39 sei();
40
13fab9f Vitja Makarov uart-loader: initial
authored
41 uart_loader();
42
5705581 Vitja Makarov Add new main()
authored
43 while (1) {
44 power_down();
45
46 if (oldsecs != seconds) {
47 uart0_puts("ticksr\r\n");
48 oldsecs = seconds;
49 }
50
51
52 /* PORTE |= (1 << PE2);
53 PORTG |= (1 << PG1);
54 PORTE |= (1 << PE7);
55 set_sleep_mode(SLEEP_MODE_PWR_DOWN);
56 sleep_mode(); */
57 }
58
59 return 0;
60 }
Something went wrong with that request. Please try again.