-
Notifications
You must be signed in to change notification settings - Fork 28
/
dispatch.h
82 lines (70 loc) · 1.41 KB
/
dispatch.h
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
75
76
77
78
79
80
81
82
#ifndef dispatch_h
#define dispatch_h
#include "util.h"
typedef enum
{
app_action_normal,
app_action_error,
app_action_empty,
app_action_disconnect,
app_action_http_ok,
app_action_reset,
} app_action_t;
assert_size(app_action_t, 4);
typedef enum
{
task_prio_low = 0,
task_prio_medium,
task_prio_high,
task_prio_size,
} task_prio_t;
typedef enum
{
task_uart_fetch_fifo,
task_uart_fill_fifo,
task_uart_bridge,
task_alert_association,
task_alert_disassociation,
task_reset,
task_run_sequencer,
task_periodic_i2c_sensors,
task_init_displays,
task_received_command,
task_display_update,
task_wlan_recovery,
task_remote_trigger,
task_wlan_reconnect,
task_pins_changed_gpio,
task_pins_changed_mcp,
task_pins_changed_pcf,
task_display_load_picture_worker,
task_invalid,
task_size = task_invalid,
} task_id_t;
enum
{
task_received_command_text,
task_received_command_packet,
task_received_command_uart
};
typedef struct
{
string_t *src;
string_t *src_oob;
string_t *dst;
int dst_data_pad_offset;
int dst_data_oob_offset;
} app_params_t;
typedef struct attr_packed
{
int16_t io;
int16_t pin;
} trigger_t;
assert_size(trigger_t, 4);
extern trigger_t trigger_alert;
extern trigger_t pcint_alert;
extern bool uart_bridge_active;
void dispatch_init1(void);
void dispatch_init2(void);
bool dispatch_post_task(task_prio_t, task_id_t, uint32_t parameter_32, uint16_t parameter_16, uint8_t parameter_8);
#endif