mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 09:58:28 -04:00
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:
parent
1fd0f73e3f
commit
f0f5761e8d
@ -34,7 +34,7 @@ namespace AP_HAL {
|
||||
|
||||
/* Typdefs for function pointers (Procedure, Timed Procedure) */
|
||||
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.
|
||||
|
@ -19,10 +19,10 @@ public:
|
||||
uint16_t min_time_ms) = 0;
|
||||
|
||||
// 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
|
||||
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
|
||||
virtual void suspend_timer_procs() = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user