Skip to content

Commit 7c06309

Browse files
author
Michael Cooper
committed
Adding packed to the structs
1 parent cc855bc commit 7c06309

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MeshBase.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "RF24.h"
66
#include "LinkedList.h"
77

8+
#define PACKED __attribute__ ((packed))
9+
810
class MeshBase
911
{
1012
public:
@@ -24,7 +26,7 @@ class MeshBase
2426
bool split_enabled : 1;
2527
uint8_t split_part : 7;
2628
uint32_t address_from;
27-
};
29+
} PACKED;
2830

2931
// -- Message types --
3032
enum message_type {
@@ -65,7 +67,7 @@ class MeshBase
6567
uint8_t application_capabilities; // What type of data do I expose
6668
uint16_t num_peers; // Number of direct peers
6769
uint32_t uptime; // Seconds since boot
68-
};
70+
} PACKED;
6971

7072
};
7173

0 commit comments

Comments
 (0)