mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_HAL_AVR_SITL: Implement new Scheduler methods
This commit is contained in:
parent
930a789b25
commit
a228519b18
@ -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"));
|
||||
|
@ -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__
|
||||
|
Loading…
Reference in New Issue
Block a user