Skip to content

Commit 5718e13

Browse files
committed
must be packed to 3 bytes
1 parent 2242ead commit 5718e13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/MCP3x6x.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ class MCP3x6x {
446446
*/
447447
union Scan {
448448
Scan(const uint8_t data[3] = MCP3x6x_CFG_SCAN) : raw{data[0], data[1], data[2]} {}
449-
struct {
449+
struct __attribute__((packed)) {
450450
union {
451451
struct {
452452
uint8_t single_ended : 8; //!< Single-Ended Channel CH0-CH7
@@ -458,9 +458,9 @@ class MCP3x6x {
458458
};
459459
uint16_t raw; //!< raw access to register
460460
} channel;
461-
uint8_t : 4; //!< unimplemented: read as ‘0’
462-
bool : 1; //!< reserved: should be set to ‘0‘
463-
enum delay dly : 3; //!< delay time between each conversion during a scan cycle
461+
uint8_t unimplemented : 4; //!< unimplemented: read as ‘0’
462+
bool reserved : 1; //!< reserved: should be set to ‘0‘
463+
enum delay dly : 3; //!< delay time between each conversion during a scan cycle
464464
};
465465
uint8_t raw[3]; //!< raw access to register
466466
} _scan;

0 commit comments

Comments
 (0)