summaryrefslogtreecommitdiff
path: root/atmel-samd/main.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-05-02 15:25:06 -0700
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-05-02 15:25:06 -0700
commit24a5752f942e3afcb5549c3622f321637375c995 (patch)
treead87d615687975ea6cb5cbe736a6f5bbbaefea82 /atmel-samd/main.c
parenta2c463deb03c715022bbbd8ba12503c323f29956 (diff)
atmel-samd: Use DMA for SPI flash block transfers.
Fixes #99
Diffstat (limited to 'atmel-samd/main.c')
-rw-r--r--atmel-samd/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/atmel-samd/main.c b/atmel-samd/main.c
index bc2979898..9ed1c3cd1 100644
--- a/atmel-samd/main.c
+++ b/atmel-samd/main.c
@@ -39,6 +39,7 @@
#endif
#include "autoreset.h"
+#include "flash_api.h"
#include "mpconfigboard.h"
#include "rgb_led_status.h"
#include "shared_dma.h"
@@ -66,8 +67,6 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) {
}
}
-extern void flash_init_vfs(fs_user_mount_t *vfs);
-
// we don't make this function static because it needs a lot of stack and we
// want it to be executed without using stack within main() function
void init_flash_fs(void) {
@@ -93,6 +92,8 @@ void init_flash_fs(void) {
vfs->flags &= ~FSUSER_USB_WRITEABLE;
res = f_mkfs("/flash", 0, 0);
+ // Flush the new file system to make sure its repaired immediately.
+ flash_flush();
if (res != FR_OK) {
MP_STATE_PORT(fs_user_mount)[0] = NULL;
return;