Skip to content
Snippets Groups Projects
Commit 3446bbbb authored by rahix's avatar rahix
Browse files

Merge 'Reset the watchdog while perfoming MSC operations'

Closes #217

See merge request !421
parents 19e42e6b fe36f377
No related branches found
No related tags found
1 merge request!421fix(usb): Reset the watchdog while perfoming MSC operations
Pipeline #4848 passed
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
#include "mx25lba.h" #include "mx25lba.h"
#include "msc.h" #include "msc.h"
#include "mxc_sys.h"
#include "wdt.h"
/* memory access callbacks for the mass storage (FLASH) device */ /* memory access callbacks for the mass storage (FLASH) device */
static int mscmem_init(); static int mscmem_init();
static uint32_t mscmem_size(void); static uint32_t mscmem_size(void);
...@@ -96,6 +99,9 @@ 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) 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); return mx25_read(lba, buffer);
} }
...@@ -105,6 +111,9 @@ static int mscmem_write(uint32_t lba, uint8_t *buffer) ...@@ -105,6 +111,9 @@ static int mscmem_write(uint32_t lba, uint8_t *buffer)
//bootloader_dirty(); //bootloader_dirty();
} }
dirty = 2; 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); return mx25_write(lba, buffer);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment