-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
83 lines (58 loc) · 1.17 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include <avr/io.h>
#include <util/delay.h>
/*peripheral includes*/
#include "peripherals/ISR.h"
#include "peripherals/USART.h"
#include "peripherals/EEPROM.h"
#include "modules/console.h"
#include "modules/shell.h"
#include "modules/timing.h"
#include "modules/led.h"
/*Local declarations*/
void init_main(void);
enum {
BLINK_DELAY_MS = 2000,
};
int main (void)
{
init_main();
/*wait for first character to be received*/
USART_Receive(0);
/*print welcome string*/
USART_printf("Hello there....................\r\n->");
DDRB |= _BV(DDB5);
while(1)
{
/*exec shell*/
shellProcess();
/*exec timer process*/
timing_process();
/*exec led updater*/
ledStringProcess();
/* set pin 5 of PORTB for output*/
//
/* set pin 5 high to turn led on */
//PORTB |= _BV(PORTB5);
//_delay_ms(BLINK_DELAY_MS*4);
/* set pin 5 low to turn led off */
//PORTB &= ~_BV(PORTB5);
//_delay_ms(BLINK_DELAY_MS);
}
return 0;
}
void init_main()
{
/*Initialize modules*/
timer_init();
led_init();
/*Initialize peripherals*/
USART_Init(1);
TIMERS_Init();
EEPROM_Init();
ws2812Init();
ledStringInit();
ledEffectInit();
adcInit();
ExtIntInit();
ISR_init();
}