mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
DataFlash: move lock to protect just buffer IO
This commit is contained in:
parent
1a0f613a0f
commit
fe8070bd51
@ -474,16 +474,15 @@ bool DataFlash_File::WritePrioritisedBlock(const void *pBuffer, uint16_t size, b
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!semaphore->take(1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! WriteBlockCheckStartupMessages()) {
|
||||
_dropped++;
|
||||
semaphore->give();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!semaphore->take(1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t _head;
|
||||
uint16_t space = BUF_SPACE(_writebuf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user