From 39f6a31418abb7801d1b383ca47b1dcbc0d4d0bd Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Fri, 5 Feb 2016 18:52:43 +0300 Subject: [PATCH] adjust persist struct --- cc3200/persist.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cc3200/persist.h b/cc3200/persist.h index d8e3ed4..defeb0d 100644 --- a/cc3200/persist.h +++ b/cc3200/persist.h @@ -5,15 +5,18 @@ #include #define PAGE_SIZE 4096 +#define MAXEV ((PAGE_SIZE - sizeof(struct hdr)) / sizeof(uint32_t)) struct persist { - uint32_t next:24; - uint32_t cold_status:1; - uint32_t hot_status:1; - uint32_t btn_status:1; - uint32_t base_count; - uint32_t timestamp; - uint32_t event[(PAGE_SIZE - offsetof(struct persist, event)) / sizeof(uint32_t)]; + struct hdr { + uint32_t next:24; + uint32_t st_cld:1; + uint32_t st_hot:1; + uint32_t st_btn:1; + uint32_t basecount; + uint32_t timestamp; + } hdr; + uint32_t event[MAXEV]; }; #endif -- 2.39.2