AP_HAL_AVR_SITL: Implement new Scheduler methods

This commit is contained in:
Pat Hickey 2013-01-10 13:50:32 -08:00
parent 930a789b25
commit a228519b18
2 changed files with 24 additions and 0 deletions

View File

@ -117,6 +117,22 @@ void SITLScheduler::resume_timer_procs() {
}
}
bool SITLScheduler::in_timerprocess() {
return _in_timer_proc;
}
bool SITLScheduler::system_initializing() {
return !_initialized;
}
void SITLScheduler::system_initialized() {
if (_initialized) {
panic(
PSTR("PANIC: scheduler system initialized called more than once"));
}
_initialized = true;
}
void SITLScheduler::sitl_end_atomic() {
if (_nested_atomic_ctr == 0)
hal.uartA->println_P(PSTR("NESTED ATOMIC ERROR"));

View File

@ -26,7 +26,13 @@ public:
void suspend_timer_procs();
void resume_timer_procs();
bool in_timerprocess();
void register_timer_failsafe(AP_HAL::TimedProc, uint32_t period_us);
bool system_initializing();
void system_initialized();
void reboot();
void panic(const prog_char_t *errormsg);
@ -54,6 +60,8 @@ private:
static uint8_t _num_timer_procs;
static bool _in_timer_proc;
bool _initialized;
};
#endif
#endif // __AP_HAL_SITL_SCHEDULER_H__