grblHAL core  20240704
task.h
Go to the documentation of this file.
1 /*
2  task.h - delayed task handling
3 
4  Part of grblHAL
5 
6  Copyright (c) 2024 Terje Io
7 
8  grblHAL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  grblHAL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef _CORE_TASK_H_
23 #define _CORE_TASK_H_
24 
25 typedef void (*foreground_task_ptr)(void *data);
26 
27 bool task_add_immediate (foreground_task_ptr fn, void *data);
28 bool task_add_delayed (foreground_task_ptr fn, void *data, uint32_t delay_ms);
29 void task_delete (foreground_task_ptr fn, void *data);
30 bool task_add_systick (foreground_task_ptr fn, void *data);
31 void task_delete_systick (foreground_task_ptr fn, void *data);
32 
33 #endif // _CORE_TASK_H_
void(* foreground_task_ptr)(void *data)
Definition: task.h:25
void task_delete(foreground_task_ptr fn, void *data)
Definition: grbllib.c:482
bool task_add_immediate(foreground_task_ptr fn, void *data)
Enqueue a function to be called once by the foreground process.
Definition: grbllib.c:548
bool task_add_systick(foreground_task_ptr fn, void *data)
Definition: grbllib.c:499
void task_delete_systick(foreground_task_ptr fn, void *data)
Definition: grbllib.c:526
bool task_add_delayed(foreground_task_ptr fn, void *data, uint32_t delay_ms)
Definition: grbllib.c:446