aboutsummaryrefslogtreecommitdiffstats
path: root/os/ex/subsystems
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-05-11 11:22:46 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-05-11 11:22:46 +0000
commitc3d1d75f50ecfe9ae36f58de67d2baf57be1be39 (patch)
tree5058c433916b6f3bc21914ec12ea0d14d3a5f474 /os/ex/subsystems
parentc9387af734393984b01a356314ed856e699cde93 (diff)
downloadChibiOS-c3d1d75f50ecfe9ae36f58de67d2baf57be1be39.tar.gz
ChibiOS-c3d1d75f50ecfe9ae36f58de67d2baf57be1be39.tar.bz2
ChibiOS-c3d1d75f50ecfe9ae36f58de67d2baf57be1be39.zip
Added smart polling and preparation for erase suspend.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9463 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ex/subsystems')
-rw-r--r--os/ex/subsystems/mfs/mfs.c4
-rw-r--r--os/ex/subsystems/mfs/mfs.h50
2 files changed, 54 insertions, 0 deletions
diff --git a/os/ex/subsystems/mfs/mfs.c b/os/ex/subsystems/mfs/mfs.c
index 7380c34a3..00488db1c 100644
--- a/os/ex/subsystems/mfs/mfs.c
+++ b/os/ex/subsystems/mfs/mfs.c
@@ -33,6 +33,10 @@
/* Driver local definitions. */
/*===========================================================================*/
+#define MFS_BANK_MAGIC1 0x35A1EC13
+#define MFS_BANK_MAGIC2 0x0FE14991
+#define MFS_HEADER_MAGIC 0x1AC7002E
+
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
diff --git a/os/ex/subsystems/mfs/mfs.h b/os/ex/subsystems/mfs/mfs.h
index a47c25c47..7abbde0da 100644
--- a/os/ex/subsystems/mfs/mfs.h
+++ b/os/ex/subsystems/mfs/mfs.h
@@ -62,6 +62,56 @@ typedef enum {
} mfs_state_t;
/**
+ * @brief Bank header.
+ * @note The header resides in the first 16 bytes of a bank extending
+ * to the next page boundary.
+ */
+typedef struct {
+ /**
+ * @brief Bank magic 1.
+ */
+ uint32_t magic1;
+ /**
+ * @brief Bank magic 2.
+ */
+ uint32_t magic2;
+ /**
+ * @brief Usage counter of the bank.
+ */
+ uint32_t counter;
+ /**
+ * @brief First data element.
+ */
+ flash_address_t next;
+} mfs_bank_header_t;
+
+/**
+ * @brief Data block header.
+ */
+typedef union {
+ struct {
+ /**
+ * @brief Data header magic.
+ */
+ uint32_t magic;
+ /**
+ * @brief Data identifier.
+ */
+ uint32_t id;
+ /**
+ * @brief Data size.
+ */
+ uint32_t size;
+ /**
+ * @brief Data CRC.
+ */
+ uint32_t crc;
+ } fields;
+ uint8_t h8[16];
+ uint32_t h32[4];
+} mfs_data_header_t;
+
+/**
* @brief Type of a MFS configuration structure.
*/
typedef struct {