Skip to content

Commit 1d12aee

Browse files
committed
The struct needs to be packed, otherwise the little trick with converting to a char pointer can backfire badly.
1 parent 9cf12fa commit 1d12aee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/motors/SmartServo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class SmartServoClass
105105
mbed::Callback<void()> _onError;
106106

107107

108-
struct {
108+
struct __attribute__((packed)) {
109109
uint8_t header [2];
110110
uint8_t id;
111111
uint8_t length;

0 commit comments

Comments
 (0)