DataFlash: don't try to write if no card inserted

This commit is contained in:
Andrew Tridgell 2013-04-02 13:07:56 +11:00
parent ddfcafe80f
commit 310a5a6be1

View File

@ -33,6 +33,9 @@ void DataFlash_Block::FinishWrite(void)
void DataFlash_Block::WriteBlock(const void *pBuffer, uint16_t size)
{
if (!CardInserted()) {
return;
}
while (size > 0) {
uint16_t n = df_PageSize - df_BufferIdx;
if (n > size) {