Browse Source

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
master
Andrew Tridgell 12 years ago
parent
commit
f0f5761e8d
  1. 2
      libraries/AP_HAL/AP_HAL_Namespace.h
  2. 8
      libraries/AP_HAL/Scheduler.h

2
libraries/AP_HAL/AP_HAL_Namespace.h

@ -34,7 +34,7 @@ namespace AP_HAL { @@ -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.

8
libraries/AP_HAL/Scheduler.h

@ -16,13 +16,13 @@ public: @@ -16,13 +16,13 @@ public:
virtual uint32_t micros() = 0;
virtual void delay_microseconds(uint16_t us) = 0;
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
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;
@ -31,7 +31,7 @@ public: @@ -31,7 +31,7 @@ public:
virtual bool in_timerprocess() = 0;
virtual void register_timer_failsafe(AP_HAL::TimedProc,
uint32_t period_us) = 0;
uint32_t period_us) = 0;
virtual bool system_initializing() = 0;
virtual void system_initialized() = 0;

Loading…
Cancel
Save