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-12-17 20:25:33 -04:00
|
|
|
#include <AP_Progmem.h>
|
2012-09-05 20:54:21 -03:00
|
|
|
|
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-12-19 22:16:10 -04:00
|
|
|
virtual void delay(uint16_t ms) = 0;
|
2012-09-05 20:54:21 -03:00
|
|
|
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;
|
2013-01-03 21:31:43 -04:00
|
|
|
|
2013-04-17 08:33:50 -03:00
|
|
|
// register a high priority timer task
|
2012-10-26 22:02:52 -03:00
|
|
|
virtual void register_timer_process(AP_HAL::TimedProc) = 0;
|
2013-04-17 08:33:50 -03:00
|
|
|
|
|
|
|
// register a low priority IO task
|
|
|
|
virtual void register_io_process(AP_HAL::TimedProc) = 0;
|
|
|
|
|
|
|
|
// suspend and resume both timer and IO processes
|
2012-09-07 20:07:16 -03:00
|
|
|
virtual void suspend_timer_procs() = 0;
|
|
|
|
virtual void resume_timer_procs() = 0;
|
2013-01-10 17:50:11 -04:00
|
|
|
|
|
|
|
virtual bool in_timerprocess() = 0;
|
2013-01-03 21:31:43 -04:00
|
|
|
|
|
|
|
virtual void register_timer_failsafe(AP_HAL::TimedProc,
|
|
|
|
uint32_t period_us) = 0;
|
2012-12-04 19:52:27 -04:00
|
|
|
|
2013-01-10 17:50:11 -04:00
|
|
|
virtual bool system_initializing() = 0;
|
|
|
|
virtual void system_initialized() = 0;
|
|
|
|
|
2012-12-17 20:25:33 -04:00
|
|
|
virtual void panic(const prog_char_t *errormsg) = 0;
|
2013-09-03 22:58:13 -03:00
|
|
|
virtual void reboot(bool hold_in_bootloader) = 0;
|
2012-08-23 15:36:13 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_HAL_SCHEDULER_H__
|
|
|
|
|