24 lines
582 B
C
Raw Normal View History

2021-02-08 14:43:23 +01:00
#ifndef _SINKSTRUCT_H_
#define _SINKSTRUCT_H_
#include <stdint.h>
#include <sha256.h>
#include <config.h>
#define SECONDS_PER_MINUTE 60
typedef struct __attribute__((__packed__)) {
char deviceId[sizeof(((t_configBlock*)0)->deviceId)];
uint8_t hash[SHA256_BLOCK_SIZE];
2021-02-15 17:58:55 +01:00
uint32_t totalRunningHours;
uint32_t totalPowercycles;
uint32_t totalWatchdogResets;
2021-02-15 12:18:19 +01:00
uint64_t timestamp;
uint32_t frequency[SECONDS_PER_MINUTE];
2021-02-08 14:43:23 +01:00
} t_minuteStruct;
2021-02-08 18:07:17 +01:00
typedef union {
t_minuteStruct s;
uint8_t b[sizeof(t_minuteStruct)];
} t_minuteBuffer;
2021-02-08 14:43:23 +01:00
#endif // _SINKSTRUCT_H_