Skip to content

Commit ef93888

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

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
@@ -106,7 +106,7 @@ class SmartServoClass
106106
mbed::Callback<void()> _onError;
107107

108108

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

0 commit comments

Comments
 (0)