AP_HAL: make timed processes take void *argument

this allows the class to be passed in, meaning that drivers that use
register_timer_process() and register_io_process() don't need to use
static members. That results in simpler, easier to read code
This commit is contained in:
Andrew Tridgell 2013-09-28 16:23:34 +10:00
parent 1fd0f73e3f
commit f0f5761e8d
2 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,7 @@ namespace AP_HAL {
/* Typdefs for function pointers (Procedure, Timed Procedure) */ /* Typdefs for function pointers (Procedure, Timed Procedure) */
typedef void(*Proc)(void); typedef void(*Proc)(void);
typedef void(*TimedProc)(uint32_t); typedef void(*TimedProc)(void *);
/** /**
* Global names for all of the existing SPI devices on all platforms. * Global names for all of the existing SPI devices on all platforms.

View File

@ -16,13 +16,13 @@ public:
virtual uint32_t micros() = 0; virtual uint32_t micros() = 0;
virtual void delay_microseconds(uint16_t us) = 0; virtual void delay_microseconds(uint16_t us) = 0;
virtual void register_delay_callback(AP_HAL::Proc, virtual void register_delay_callback(AP_HAL::Proc,
uint16_t min_time_ms) = 0; uint16_t min_time_ms) = 0;
// register a high priority timer task // register a high priority timer task
virtual void register_timer_process(AP_HAL::TimedProc) = 0; virtual void register_timer_process(AP_HAL::TimedProc, void *) = 0;
// register a low priority IO task // register a low priority IO task
virtual void register_io_process(AP_HAL::TimedProc) = 0; virtual void register_io_process(AP_HAL::TimedProc, void *) = 0;
// suspend and resume both timer and IO processes // suspend and resume both timer and IO processes
virtual void suspend_timer_procs() = 0; virtual void suspend_timer_procs() = 0;
@ -31,7 +31,7 @@ public:
virtual bool in_timerprocess() = 0; virtual bool in_timerprocess() = 0;
virtual void register_timer_failsafe(AP_HAL::TimedProc, virtual void register_timer_failsafe(AP_HAL::TimedProc,
uint32_t period_us) = 0; uint32_t period_us) = 0;
virtual bool system_initializing() = 0; virtual bool system_initializing() = 0;
virtual void system_initialized() = 0; virtual void system_initialized() = 0;