mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-11 20:59:22 +08:00
DataFlash: move lock to protect just buffer IO
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user