-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
executable file
·74 lines (57 loc) · 2.12 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
//******************************************************************************
//
// Filename : main.c
// Dependencies: all
// Processor: PIC18
// Complier: MCC18 v3.37 or higher
// Company: HVA.
// Auther: Ferry
// Date: 2012-02-20
// Version: 1.0
//
//******************************************************************************
#include "includes.h"
#include "task_display.h"
#include "task_heartbeat.h"
#include "task_server.h"
#include "task_run.h"
#include "RotatingQueue.h"
//******************************************************************************
// Tasks
//******************************************************************************
extern void Task_Display(void);
extern void Task_Heartbeat(void);
extern void Task_Server(void);
extern void Task_Run(void);
//******************************************************************************
//** Reset vector mapping **
//******************************************************************************
extern void _startup(void); // See c018i.c in your C18 compiler dir
// Vector moved hid bootloader in place
#pragma code _RESET_INTERRUPT_VECTOR = 0x001000
void _reset(void) {
_asm goto _startup _endasm
}
// end reset vector code
#pragma code
//******************************************************************************
// Main
//******************************************************************************
void main(void) {
OS_Init(); // OS System init
ADC_init(); // Should be done first
PWM_init(); // Beware pwm ports go together with ANALOG in
setPortBIO(0x04); // Set port B in output mode
setPortDIO(0x00); // Set port D in output mode
XLCDInit(); // initialize the LCD module
XLCDClear();
// Push een kleine lijst
//push(2);
//push(1);
//push(3);
OS_Task_Create(0, Task_Server); // BT Connection
OS_Task_Create(1, Task_Hartbeat); // Show I am alive (called by scheduler)//
OS_Task_Create(1, Task_Run); // Run me through the maze (called by scheduler)//
OS_Task_Create(2, Task_Display); // be called by scheduler
OS_Run(); // Run scheduler
}