-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpals_task.h
More file actions
49 lines (38 loc) · 823 Bytes
/
pals_task.h
File metadata and controls
49 lines (38 loc) · 823 Bytes
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
#ifndef PALS__PALS_TASK_H
#define PALS__PALS_TASK_H
#include "pals_base.h"
#include "pals_time.h"
#include "pals_port.h"
#include "pals_msg.h"
#include <stdint.h>
typedef struct _phase {
uint32_t start_time;
void (*run)();
} phase_t;
typedef struct _task_state {
pals_time_t pals_base_time;
pals_time_t pals_phase_base_time;
uint32_t cur_phase;
} task_state_t;
typedef struct _task {
// config
uint32_t task_id;
uint32_t group_id;
uint64_t period;
// phases
uint32_t num_phases;
phase_t phases[MAX_NUM_PHASES];
// socket
int socket_tx;
int socket_rx;
int socket_mcast_tx;
int socket_mcast_rx;
// ports
tx_pals_port_set_t tx_port_set;
rx_pals_port_set_t rx_port_set;
// state
task_state_t state;
} task_t;
// Global variable
task_t task;
#endif /* PALS__PALS_TASK_H */