Skip to content

Commit 08b59cb

Browse files
peterbarkertridge
authored andcommitted
SRV_Channel: iterate using ARRAY_SIZE in place of constant
1 parent d637b46 commit 08b59cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/SRV_Channel/SRV_Channel_aux.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ void SRV_Channels::set_output_pwm(SRV_Channel::Function function, uint16_t value
354354
if (!function_assigned(function)) {
355355
return;
356356
}
357-
for (uint8_t i = 0; i < NUM_SERVO_CHANNELS; i++) {
357+
// channels is a pointer assigned from obj_channels:
358+
for (uint8_t i = 0; i < ARRAY_SIZE(obj_channels); i++) {
358359
if (channels[i].function == function) {
359360
channels[i].set_output_pwm(value);
360361
channels[i].output_ch();

0 commit comments

Comments
 (0)