mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 12:00:35 +08:00
STM32: optimized clock instance access
This commit is contained in:
@@ -405,8 +405,6 @@ void setUtcSyncParams(const UtcSyncParams& params)
|
||||
|
||||
SystemClock& SystemClock::instance()
|
||||
{
|
||||
MutexLocker mlocker(clock::mutex);
|
||||
|
||||
static union SystemClockStorage
|
||||
{
|
||||
uavcan::uint8_t buffer[sizeof(SystemClock)];
|
||||
@@ -418,6 +416,7 @@ SystemClock& SystemClock::instance()
|
||||
|
||||
if (!clock::initialized)
|
||||
{
|
||||
MutexLocker mlocker(clock::mutex);
|
||||
clock::init();
|
||||
new (ptr)SystemClock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user