mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_RTC: added get_semaphore()
This commit is contained in:
parent
2e1b4cadc2
commit
dc3e345a05
@ -63,6 +63,7 @@ void AP_RTC::set_utc_usec(uint64_t time_utc_usec, source_type type)
|
||||
// can't allow time to go backwards, ever
|
||||
return;
|
||||
}
|
||||
WITH_SEMAPHORE(rsem);
|
||||
|
||||
rtc_shift = tmp;
|
||||
|
||||
|
@ -49,9 +49,15 @@ public:
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
// allow threads to lock against RTC update
|
||||
HAL_Semaphore &get_semaphore(void) {
|
||||
return rsem;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static AP_RTC *_singleton;
|
||||
HAL_Semaphore_Recursive rsem;
|
||||
|
||||
source_type rtc_source_type = SOURCE_NONE;
|
||||
int64_t rtc_shift;
|
||||
|
Loading…
Reference in New Issue
Block a user