mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-28 19:48:31 -04:00
AP_HAL: added begin_atomic and end_atomic to scheduler
This commit is contained in:
parent
197a685923
commit
c9541d3b00
@ -22,6 +22,9 @@ public:
|
||||
uint32_t period_us) = 0;
|
||||
virtual void suspend_timer_procs() = 0;
|
||||
virtual void resume_timer_procs() = 0;
|
||||
|
||||
virtual void begin_atomic() = 0;
|
||||
virtual void end_atomic() = 0;
|
||||
};
|
||||
|
||||
#endif // __AP_HAL_SCHEDULER_H__
|
||||
|
@ -321,3 +321,11 @@ void ArduinoScheduler::_timer_event() {
|
||||
|
||||
_in_timer_proc = false;
|
||||
}
|
||||
|
||||
void ArduinoScheduler::begin_atomic() {
|
||||
cli();
|
||||
}
|
||||
|
||||
void ArduinoScheduler::end_atomic() {
|
||||
sei();
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ public:
|
||||
void register_timer_failsafe(AP_HAL::TimedProc, uint32_t period_us);
|
||||
void suspend_timer_procs();
|
||||
void resume_timer_procs();
|
||||
void begin_atomic();
|
||||
void end_atomic();
|
||||
|
||||
private:
|
||||
/* Implementation specific methods: */
|
||||
|
Loading…
Reference in New Issue
Block a user