mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-28 11:38:44 -04:00
DataFlash: don't try to write if no card inserted
This commit is contained in:
parent
ddfcafe80f
commit
310a5a6be1
@ -33,6 +33,9 @@ void DataFlash_Block::FinishWrite(void)
|
|||||||
|
|
||||||
void DataFlash_Block::WriteBlock(const void *pBuffer, uint16_t size)
|
void DataFlash_Block::WriteBlock(const void *pBuffer, uint16_t size)
|
||||||
{
|
{
|
||||||
|
if (!CardInserted()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
uint16_t n = df_PageSize - df_BufferIdx;
|
uint16_t n = df_PageSize - df_BufferIdx;
|
||||||
if (n > size) {
|
if (n > size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user