Skip to content

Commit a318c3b

Browse files
IamPete1peterbarker
authored andcommitted
AP_Servo_Telem: allow more telem channels than outputs on periph
1 parent 093c976 commit a318c3b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libraries/AP_Servo_Telem/AP_Servo_Telem.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@
99

1010

1111
#ifndef SERVO_TELEM_MAX_SERVOS
12-
#define SERVO_TELEM_MAX_SERVOS NUM_SERVO_CHANNELS
12+
#ifndef HAL_BUILD_AP_PERIPH
13+
// On a vehicle board we only expect responses from those servos we directly control
14+
#define SERVO_TELEM_MAX_SERVOS NUM_SERVO_CHANNELS
15+
#else
16+
// On periph we handle a sub-set of outputs from a vehicle, because we don't know
17+
// which indexes those will be we have to support more telem channels than outputs
18+
// This allows output ID 10 to be output on the first servo channel.
19+
// This should be reported to the vehicle as ID 10 not ID 1.
20+
#define SERVO_TELEM_MAX_SERVOS 32
21+
#endif
1322
#endif
1423
static_assert(SERVO_TELEM_MAX_SERVOS > 0, "Cannot have 0 Servo telem instances");
1524

0 commit comments

Comments
 (0)