From 3d5d76fb7384cd6c0bcd62f6a6799261b73f786d Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 11 Apr 2018 16:52:22 +1000 Subject: [PATCH] stm32/main: Allow a board to configure the label of the flash FS. To change the default label a board should define: #define MICROPY_HW_FLASH_FS_LABEL "label" --- ports/stm32/main.c | 2 +- ports/stm32/mpconfigboard_common.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/stm32/main.c b/ports/stm32/main.c index 120ab5b670..4d0e7434be 100644 --- a/ports/stm32/main.c +++ b/ports/stm32/main.c @@ -192,7 +192,7 @@ MP_NOINLINE STATIC bool init_flash_fs(uint reset_mode) { } // set label - f_setlabel(&vfs_fat->fatfs, "pybflash"); + f_setlabel(&vfs_fat->fatfs, MICROPY_HW_FLASH_FS_LABEL); // create empty main.py FIL fp; diff --git a/ports/stm32/mpconfigboard_common.h b/ports/stm32/mpconfigboard_common.h index 857457fdb7..97c21d0227 100644 --- a/ports/stm32/mpconfigboard_common.h +++ b/ports/stm32/mpconfigboard_common.h @@ -92,6 +92,11 @@ #define MICROPY_HW_HAS_LCD (0) #endif +// The volume label used when creating the flash filesystem +#ifndef MICROPY_HW_FLASH_FS_LABEL +#define MICROPY_HW_FLASH_FS_LABEL "pybflash" +#endif + /*****************************************************************************/ // General configuration