2012-08-23 15:36:13 -03:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_SCHEDULER_H__
|
|
|
|
#define __AP_HAL_SCHEDULER_H__
|
|
|
|
|
|
|
|
#include "AP_HAL_Namespace.h"
|
|
|
|
|
2012-09-05 20:54:21 -03:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2012-08-23 15:36:13 -03:00
|
|
|
class AP_HAL::Scheduler {
|
|
|
|
public:
|
2012-09-06 15:20:12 -03:00
|
|
|
Scheduler() {}
|
2012-09-07 20:07:16 -03:00
|
|
|
virtual void init(void* implspecific) = 0;
|
2012-09-05 20:54:21 -03:00
|
|
|
virtual void delay(uint32_t ms) = 0;
|
|
|
|
virtual uint32_t millis() = 0;
|
|
|
|
virtual uint32_t micros() = 0;
|
|
|
|
virtual void delay_microseconds(uint16_t us) = 0;
|
2012-10-26 22:02:52 -03:00
|
|
|
virtual void register_delay_callback(AP_HAL::Proc,
|
|
|
|
uint16_t min_time_ms) = 0;
|
|
|
|
virtual void register_timer_process(AP_HAL::TimedProc) = 0;
|
2012-10-11 18:49:39 -03:00
|
|
|
virtual bool defer_timer_process(AP_HAL::TimedProc) = 0;
|
2012-09-07 20:07:16 -03:00
|
|
|
virtual void register_timer_failsafe(AP_HAL::TimedProc,
|
|
|
|
uint32_t period_us) = 0;
|
|
|
|
virtual void suspend_timer_procs() = 0;
|
|
|
|
virtual void resume_timer_procs() = 0;
|
2012-11-19 20:57:30 -04:00
|
|
|
|
|
|
|
virtual void begin_atomic() = 0;
|
|
|
|
virtual void end_atomic() = 0;
|
2012-08-23 15:36:13 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_HAL_SCHEDULER_H__
|
|
|
|
|