Browse Source

AP_HAL_AVR_SITL: Implement new Scheduler methods

master
Pat Hickey 12 years ago
parent
commit
a228519b18
  1. 16
      libraries/AP_HAL_AVR_SITL/Scheduler.cpp
  2. 8
      libraries/AP_HAL_AVR_SITL/Scheduler.h

16
libraries/AP_HAL_AVR_SITL/Scheduler.cpp

@ -117,6 +117,22 @@ void SITLScheduler::resume_timer_procs() { @@ -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"));

8
libraries/AP_HAL_AVR_SITL/Scheduler.h

@ -26,7 +26,13 @@ public: @@ -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: @@ -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…
Cancel
Save