Skip to content

Commit

Permalink
Merge pull request #1257 from IMRCLab/bugfix_usd2
Browse files Browse the repository at this point in the history
usddeck: improve error handling on write
  • Loading branch information
krichardsson authored Mar 27, 2023
2 parents 1346781 + 1541633 commit 41705c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/deck/drivers/src/usddeck.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,13 @@ static void usdWriteData(const void *data, size_t size)
{
UINT bytesWritten;
FRESULT status = f_write(&logFile, data, size, &bytesWritten);
ASSERT(status == FR_OK);
crc32Update(&crcContext, data, size);
STATS_CNT_RATE_MULTI_EVENT(&fatWriteRate, bytesWritten);
if (status != FR_OK) {
DEBUG_PRINT("usd deck write failure %d\n", status);
enableLogging = false;
} else {
crc32Update(&crcContext, data, size);
STATS_CNT_RATE_MULTI_EVENT(&fatWriteRate, bytesWritten);
}
}

static void usdWriteTask(void* prm)
Expand Down

0 comments on commit 41705c4

Please sign in to comment.