Skip to content
Snippets Groups Projects

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

Merged schneider requested to merge schneider/217-kick-wdt-in-msc into master
1 file
+ 9
0
Compare changes
  • Side-by-side
  • Inline
+ 9
0
@@ -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);
}
Loading