-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCCU_status.h
34 lines (27 loc) · 885 Bytes
/
CCU_status.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <string.h>
#include <stdint.h>
#ifdef HT_DEBUG_EN
#include "Arduino.h"
#endif
#pragma pack(push,1)
// @Parseclass
class CCU_status {
public:
CCU_status() = default;
CCU_status(uint8_t buf[]) { load(buf); }
inline void load(uint8_t buf[]) { memcpy(this, buf, sizeof(*this)); }
inline void write(uint8_t buf[]) const { memcpy(buf, this, sizeof(*this)); }
inline bool get_charger_enabled() const { return charger_enabled; }
inline void set_charger_enabled(bool charger_enabled) { this->charger_enabled = charger_enabled; }
#ifdef HT_DEBUG_EN
void print() {
SerialUSB.println("\n\nCCU STATUS");
SerialUSB.println( "---------");
SerialUSB.print("CHARGING: "); SerialUSB.println(charger_enabled);
}
#endif
private:
bool charger_enabled; // @Parse
};
#pragma pack(pop)