42
|
1 #ifndef INCLUDED_SCHEDULER
|
|
2 #define INCLUDED_SCHEDULER
|
|
3
|
|
4 #ifndef INCLUDED_TASK
|
|
5 # include "task.h"
|
|
6 #endif
|
|
7
|
|
8 #ifndef INCLUDED_DMA_MANAGER
|
|
9 # include "DmaManager.h"
|
|
10 #endif
|
|
11
|
|
12 #ifndef INCLUDED_SCHED_TASK_BASE
|
|
13 # include "SchedTaskBase.h"
|
|
14 #endif
|
|
15
|
|
16 class SchedTaskBase;
|
|
17
|
|
18 class Scheduler {
|
|
19 public:
|
|
20 virtual ~Scheduler(void) {}
|
|
21
|
|
22 /* variables */
|
|
23 TaskListPtr listBuf[2];
|
|
24 void *readBuf[2];
|
|
25 void *writeBuf[2];
|
|
26 int listBufFlg;
|
|
27 int readBufFlg;
|
|
28 int writeBufFlg;
|
|
29
|
|
30 DmaManager* connector;
|
|
31
|
|
32 SchedTaskBase* task1;
|
|
33 SchedTaskBase* task2;
|
|
34 SchedTaskBase* task3;
|
|
35
|
|
36 /* functions */
|
|
37 void init(void);
|
|
38 void run(void);
|
|
39 virtual void init_impl(void) = 0;
|
50
|
40 void finish(void);
|
42
|
41
|
|
42 TaskListPtr get_curListBuf(void);
|
|
43 void* get_curReadBuf(void);
|
|
44 void* get_curWriteBuf(void);
|
|
45 };
|
|
46
|
|
47 #endif
|