]> www.average.org Git - pulsecounter.git/blob - cc3200/persist.h
adjust persist struct
[pulsecounter.git] / cc3200 / persist.h
1 #ifndef _PERSIST_H
2 #define _PERSIST_H
3
4 #include <stddef.h>
5 #include <stdint.h>
6
7 #define PAGE_SIZE 4096
8 #define MAXEV ((PAGE_SIZE - sizeof(struct hdr)) / sizeof(uint32_t))
9
10 struct persist {
11         struct hdr {
12                 uint32_t next:24;
13                 uint32_t st_cld:1;
14                 uint32_t st_hot:1;
15                 uint32_t st_btn:1;
16                 uint32_t basecount;
17                 uint32_t timestamp;
18         } hdr;
19         uint32_t event[MAXEV];
20 };
21
22 #endif