AP_Scheduler: allow to use functor

This commit is contained in:
Lucas De Marchi 2015-05-24 18:55:06 -03:00 committed by Andrew Tridgell
parent 58847bffd6
commit 78b00784fb
2 changed files with 6 additions and 2 deletions

View File

@ -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();

View File

@ -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);