forked from art103/LasaurGrbl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.h
56 lines (44 loc) · 1.21 KB
/
tasks.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
/*
tasks.h - manage non-ISR tasks
Part of LasaurGrbl
Copyright (c) 2013 Richard Taylor
LasaurGrbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LasaurGrbl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifndef tasks_h
#define tasks_h
#include <stdint.h>
#include "config.h"
// Available tasks.
// Uses 1 bit per task, so adjust task_t if you need > 16 tasks.
typedef enum {
TASK_READY_WAIT = 0,
TASK_SERIAL_RX,
TASK_MANUAL_MOVE,
TASK_SET_OFFSET,
TASK_MOTOR_DELAY,
#ifdef ENABLE_LCD
TASK_UPDATE_LCD,
#endif
TASK_END,
} TASK;
typedef uint16_t task_t;
// non-trivial data structures.
struct task_manual_move_data {
double x_offset;
double y_offset;
double z_offset;
double rate;
};
void tasks_init(void);
void tasks_loop(void);
void task_enable(TASK task, void* data);
void task_disable(TASK task);
uint8_t task_running(TASK task);
#endif