-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
47 lines (38 loc) · 894 Bytes
/
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
#include <msp430.h>
#include "sheduler.h"
#include "led.h"
#include "uart.h"
#include "trafic.h"
//Helper when task cannot be run with argument
void uart_write_count(void)
{
uart_write("C\n\r");
}
void main(void)
{
//Stop watchdog timer
WDTCTL = WDTPW | WDTHOLD;
//Init sheduler
SCH_Init();
//Init led output
led_init();
//Init button
ports_init();
//Init uart output
uart_init();
//Init trfic state machine
trafic_lights_init(OUT_OF_ORDER);
//Tur on leds to show they are working
//led_red_on();
//led_green_on();
//Add tasks to task list
//SCH_Add_Task(led_red_toggle, 0, 100);
//SCH_Add_Task(led_green_toggle, 0, 200);
//SCH_Add_Task(uart_write_count, 500, 100);
SCH_Add_Task(trafic_lights_update, 0, 50);
while (1)
{
//Dispach tasks set to run
SCH_Dispatch_Tasks();
}
}