mirror of https://github.com/ArduPilot/ardupilot
AP_Scheduler: allow to use functor
This commit is contained in:
parent
58847bffd6
commit
78b00784fb
|
@ -88,7 +88,9 @@ void AP_Scheduler::run(uint16_t time_available)
|
|||
task_fn_t func;
|
||||
pgm_read_block(&_tasks[i].function, &func, sizeof(func));
|
||||
current_task = i;
|
||||
#if AP_SCHEDULER_USE_DELEGATE_PTR
|
||||
#if APM_BUILD_FUNCTOR
|
||||
func();
|
||||
#elif AP_SCHEDULER_USE_DELEGATE_PTR
|
||||
func(_classptr);
|
||||
#else
|
||||
func();
|
||||
|
|
|
@ -47,7 +47,9 @@
|
|||
class AP_Scheduler
|
||||
{
|
||||
public:
|
||||
#if APM_BUILD_DELEGATES
|
||||
#if APM_BUILD_FUNCTOR
|
||||
FUNCTOR_TYPEDEF(task_fn_t, void);
|
||||
#elif APM_BUILD_DELEGATES
|
||||
DELEGATE_FUNCTION_VOID_TYPEDEF(task_fn_t);
|
||||
#else
|
||||
typedef void (*task_fn_t)(void);
|
||||
|
|
Loading…
Reference in New Issue