-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test6TaskDxl.c
74 lines (65 loc) · 2.4 KB
/
Test6TaskDxl.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
/*
Copyright (C) 2018 ER2C
Politektik Elektronika Negeri Surabaya
Agung Pambudi <[email protected]>
*/
///////////////////////////////////////////////////////////////////////////////
// Includes
///////////////////////////////////////////////////////////////////////////////
#include "flowrtos.h"
////////////////////////////////////////////////////////////////////////////////
// Code
////////////////////////////////////////////////////////////////////////////////
void task1(){
PRINTF("Task 1 | p = d = 900 ms | c = 200 ms | %u us = start\n\r", count_time_us);
delay_us(200000);
PRINTF("Task 1 | p = d = 900 ms | c = 200 ms | %u us = finish\n\r", count_time_us);
}
void task2(){
PRINTF("Task 2 | p = d = 600 ms | c = 200 ms | %u us = start\n\r", count_time_us);
delay_us(200000);
PRINTF("Task 2 | p = d = 600 ms | c = 200 ms | %u us = finish\n\r", count_time_us);
}
void task3(){
PRINTF("Task 3 | p = d = 800 ms | c = 100 ms | %u us = start\n\r", count_time_us);
delay_us(100000);
PRINTF("Task 3 | p = d = 800 ms | c = 100 ms | %u us = finish\n\r", count_time_us);
}
void task4(){
PRINTF("Task 4 | p = d = 400 ms | c = 100 ms | %u us = start\n\r", count_time_us);
delay_us(100000);
PRINTF("Task 4 | p = d = 400 ms | c = 100 ms | %u us = finish\n\r", count_time_us);
}
void task5(){
PRINTF("Task 5 | p = d = 500 ms | c = 100 ms | %u us = start\n\r", count_time_us);
delay_us(100000);
PRINTF("Task 5 | p = d = 500 ms | c = 100 ms | %u us = finish\n\r", count_time_us);
}
void task6(){
PRINTF("Task 6 | p = d = 700 ms | c = 200 ms | %u us = start\n\r", count_time_us);
delay_us(200000);
PRINTF("Task 6 | p = d = 700 ms | c = 200 ms | %u us = finish\n\r", count_time_us);
}
int main(void){
management_io();
management_timer_init();
management_memory_init();
management_task_init();
create_task(task5,500000,500000,0);
create_task(task2,600000,600000,0);
create_task(task6,700000,700000,0);
create_task(task4,400000,400000,0);
create_task(task1,900000,900000,0);
create_task(task3,800000,800000,0);
dxl_uart_init();
PRINTF("BISMILLAH PASTI BISA!\n\r");
scheduler();
while(true);
}
/*
uart 2 115200 debug
uart 5 57600 dxl
*/
/*******************************************************************************
* EOF
******************************************************************************/