diff --git a/libraries/AP_Scheduler/AP_Scheduler.cpp b/libraries/AP_Scheduler/AP_Scheduler.cpp index 38ea988d7e..7de74f50aa 100644 --- a/libraries/AP_Scheduler/AP_Scheduler.cpp +++ b/libraries/AP_Scheduler/AP_Scheduler.cpp @@ -39,14 +39,13 @@ const AP_Param::GroupInfo AP_Scheduler::var_info[] PROGMEM = { }; // initialise the scheduler -void AP_Scheduler::init(const AP_Scheduler::Task *tasks, uint8_t num_tasks, void *classptr) +void AP_Scheduler::init(const AP_Scheduler::Task *tasks, uint8_t num_tasks) { _tasks = tasks; _num_tasks = num_tasks; _last_run = new uint16_t[_num_tasks]; memset(_last_run, 0, sizeof(_last_run[0]) * _num_tasks); _tick_counter = 0; - _classptr = classptr; } // one tick has passed @@ -90,8 +89,6 @@ void AP_Scheduler::run(uint16_t time_available) current_task = i; #if APM_BUILD_FUNCTOR func(); -#elif AP_SCHEDULER_USE_DELEGATE_PTR - func(_classptr); #else func(); #endif diff --git a/libraries/AP_Scheduler/AP_Scheduler.h b/libraries/AP_Scheduler/AP_Scheduler.h index efde8e6033..2ae9e5fd22 100644 --- a/libraries/AP_Scheduler/AP_Scheduler.h +++ b/libraries/AP_Scheduler/AP_Scheduler.h @@ -38,19 +38,11 @@ #include #include -#if APM_BUILD_DELEGATES && defined(__AVR__) -#define AP_SCHEDULER_USE_DELEGATE_PTR 1 -#else -#define AP_SCHEDULER_USE_DELEGATE_PTR 0 -#endif - class AP_Scheduler { public: #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); #endif @@ -62,7 +54,7 @@ public: }; // initialise scheduler - void init(const Task *tasks, uint8_t num_tasks, void *classptr); + void init(const Task *tasks, uint8_t num_tasks); // call when one tick has passed void tick(void); @@ -116,9 +108,6 @@ private: // number of ticks that _spare_micros is counted over uint8_t _spare_ticks; - - // class pointer for use on AVR - void *_classptr; }; #endif // AP_SCHEDULER_H