Statistics
| Revision:

root / trunk / code / projects / scheduler / main.c @ 1573

History | View | Annotate | Download (599 Bytes)

1
#include <serial.h>
2
#include <avr/interrupt.h>
3
#include "scheduler.h"
4

    
5
void task0(void);
6
void task1(void);
7
void task2(void);
8

    
9
int main(void)
10
{
11
        //Granularity is currently seconds, 
12
        usb_init();
13

    
14
        usb_puts("Oh no!!! Reset!!\n\r");
15

    
16
        scheduler_init();
17
        register_task(task0, 22);
18
        //register_task(task1, 2);
19
        //register_task(task2, 3);
20

    
21
        while (1) {
22
                //usb_puti(time_now());
23
                usb_puts("main\n\r");
24
                delay_ms(200);
25
        }
26

    
27
        return 0;
28
}
29

    
30
void task0() { 
31
        sei();
32
        usb_puts("0\n\r");
33
        
34
        cli();
35
}
36

    
37
void task1() { 
38
        sei();
39
        usb_puts("1\n\r");
40
        cli();
41
}
42

    
43
void task2() { 
44
        sei();
45
        usb_puts("2\n\r");
46
        cli();
47
}