Skip to content
Snippets Groups Projects
Commit fe36f377 authored by schneider's avatar schneider
Browse files

fix(usb): Reset the watchdog while perfoming MSC operations

The MSC interrupts can come in back to back, effectively blocking
the FreeRTOS timer task which resets the watchdog. This simple fix
simply resets the watchdog when performing an MSC read or write.
parent 19e42e6b
Branches
Tags v1.3
1 merge request!421fix(usb): Reset the watchdog while perfoming MSC operations
Pipeline #4847 passed
......@@ -24,6 +24,9 @@
#include "mx25lba.h"
#include "msc.h"
#include "mxc_sys.h"
#include "wdt.h"
/* memory access callbacks for the mass storage (FLASH) device */
static int mscmem_init();
static uint32_t mscmem_size(void);
......@@ -96,6 +99,9 @@ static uint32_t mscmem_size(void)
static int mscmem_read(uint32_t lba, uint8_t *buffer)
{
/* Reset the watchdog as this interrupt might be
* firing back to back for a few seconds. */
WDT_ResetTimer(MXC_WDT0);
return mx25_read(lba, buffer);
}
......@@ -105,6 +111,9 @@ static int mscmem_write(uint32_t lba, uint8_t *buffer)
//bootloader_dirty();
}
dirty = 2;
/* Reset the watchdog as this interrupt might be
* firing back to back for a few seconds. */
WDT_ResetTimer(MXC_WDT0);
return mx25_write(lba, buffer);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment