projects
/
pulsecounter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8613fd8
)
adjust persist struct
master
author
Eugene Crosser
<crosser@average.org>
Fri, 5 Feb 2016 15:52:43 +0000
(18:52 +0300)
committer
Eugene Crosser
<crosser@average.org>
Fri, 5 Feb 2016 15:52:43 +0000
(18:52 +0300)
cc3200/persist.h
patch
|
blob
|
history
diff --git
a/cc3200/persist.h
b/cc3200/persist.h
index d8e3ed4531edbeed4405b73fba61624723c00967..defeb0dbfe2501a295cc647775ba926e9765c46a 100644
(file)
--- a/
cc3200/persist.h
+++ b/
cc3200/persist.h
@@
-5,15
+5,18
@@
#include <stdint.h>
#define PAGE_SIZE 4096
#include <stdint.h>
#define PAGE_SIZE 4096
+#define MAXEV ((PAGE_SIZE - sizeof(struct hdr)) / sizeof(uint32_t))
struct persist {
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
};
#endif