-
Notifications
You must be signed in to change notification settings - Fork 0
/
DDC-Z.c
61 lines (55 loc) · 1.66 KB
/
DDC-Z.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
/*------------------------------------------------------------------*-
DDC-Z.c (v1.00)
------------------------------------------------------------------
COPYRIGHT
---------
This code is copyright (c) 2015 by Richard Zhang.
-*------------------------------------------------------------------*/
#include "Main.h"
#include "Port.h"
#include "hSch51.h"
#include "Timer.h"
#include "Elecmotor.h"
#include "Button.h"
#include "UART.h"
#include "communication.h"
#include "Speech.h"
#include "Function.h"
#include "Sensor.h"
#include "Alarm.h"
#include "Battery.h"
#include "Function.h"
#include "Function-S.h"
/* ............................................................... */
void main(void)
{
// Initialize all tasks
Speech_Init();
UART_Init(BAUD9600);
Timer0_Init(500);
Elecmotor_Init();
Button_Init();
Battery_Init();
Sensor_Init();
Alarm_Init();
Function_init();
Function_S_init();
// Add Tasks
hSCH_Add_Task(Elecmotor_update, 1000, 1, 1); // 1ms/ticket
hSCH_Add_Task(Button_update, 1500, 200, 1); // 100ms/ticket
hSCH_Add_Task(Speech_update, 1500, 1000, 1); // 0.5s/ticket
hSCH_Add_Task(Sensor_update, 2000, 1, 1); // 1ms/ticket
hSCH_Add_Task(Alarm_update, 3000, 2000, 1); // 1s/ticket
hSCH_Add_Task(Function_update, 1500, 4000, 1); // 2s/ticket
hSCH_Add_Task(Function_s_update, 2000, 1, 1); // 1ms/ticket
// Start the program.
hSCH_Start();
while(1)
{
// Excute the program.
hSCH_Dispatch_Tasks();
}
}
/*------------------------------------------------------------------*-
---- END OF FILE -------------------------------------------------
-*------------------------------------------------------------------*/