mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
AP_PeriodicProcess: added running() method which tells the caller whether the timer is suspended or not
This commit is contained in:
parent
00e79e7915
commit
c007a19200
@ -15,5 +15,8 @@ void AP_PeriodicProcessStub::suspend_timer(void) {
|
||||
}
|
||||
void AP_PeriodicProcessStub::resume_timer(void) {
|
||||
}
|
||||
bool AP_PeriodicProcessStub::running(void) {
|
||||
return !_suspended;
|
||||
}
|
||||
void AP_PeriodicProcessStub::run(void) {
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
bool queue_process(ap_procedure proc); // queue process to run as soon as possible after any currently running ap_processes complete. returns true if it ran immediately
|
||||
void suspend_timer(void);
|
||||
void resume_timer(void);
|
||||
bool running();
|
||||
static void run(void);
|
||||
protected:
|
||||
static uint8_t _period;
|
||||
|
@ -96,6 +96,10 @@ void AP_TimerProcess::resume_timer(void)
|
||||
_suspended = false;
|
||||
}
|
||||
|
||||
bool AP_TimerProcess::running(void) {
|
||||
return !_suspended;
|
||||
}
|
||||
|
||||
void AP_TimerProcess::run(void)
|
||||
{
|
||||
// we enable the interrupt again immediately and also enable
|
||||
|
@ -20,6 +20,7 @@ public:
|
||||
void set_failsafe(ap_procedure proc);
|
||||
void suspend_timer(void);
|
||||
void resume_timer(void);
|
||||
bool running();
|
||||
static void run(void);
|
||||
protected:
|
||||
static uint8_t _period;
|
||||
|
@ -17,6 +17,7 @@ public:
|
||||
virtual bool queue_process(ap_procedure proc) = 0; // queue process to run as soon as possible after any currently running ap_processes complete. returns true if it ran immediately
|
||||
virtual void suspend_timer(void) = 0;
|
||||
virtual void resume_timer(void) = 0;
|
||||
virtual bool running() = 0;
|
||||
};
|
||||
|
||||
#endif // __PERIODICPROCESS_H__
|
||||
|
Loading…
Reference in New Issue
Block a user