Skip to content

Commit d85eaad

Browse files
committed
Fix: Broadcast is also valid id.
1 parent 8309a16 commit d85eaad

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
@@ -86,7 +86,7 @@ class SmartServoClass
8686
static int constexpr MAX_POSITION = 4000;
8787

8888
inline bool isValidAngle(float const angle) { return ((angle >= 0.0f) && (angle <= MAX_ANGLE)); }
89-
inline bool isValidId(int const id) const { return ((id >= MIN_MOTOR_ID) && (id <= MAX_MOTOR_ID)); }
89+
inline bool isValidId(int const id) const { return ((id >= MIN_MOTOR_ID) && (id <= MAX_MOTOR_ID)) || (id == BROADCAST); }
9090

9191
int calcChecksum ();
9292
void sendPacket ();

0 commit comments

Comments
 (0)