Skip to content
Snippets Groups Projects
Commit 5f269009 authored by DonLakeFlyer's avatar DonLakeFlyer
Browse files

Base channel max solely on channel count
parent 8fdbaf3f
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,7 @@ RCChannelMonitorController::RCChannelMonitorController(void)
void RCChannelMonitorController::_rcChannelsChanged(int channelCount, int pwmValues[Vehicle::cMaxRcChannels])
{
int maxChannel = std::min(channelCount, _chanMax());
for (int channel=0; channel<maxChannel; channel++) {
for (int channel=0; channel<channelCount; channel++) {
int channelValue = pwmValues[channel];
if (_chanCount != channelCount) {
......@@ -33,8 +31,3 @@ void RCChannelMonitorController::_rcChannelsChanged(int channelCount, int pwmVal
}
}
}
int RCChannelMonitorController::_chanMax(void) const
{
return _vehicle->firmwareType() == MAV_AUTOPILOT_PX4 ? _chanMaxPX4 : _chanMaxAPM;
}
......@@ -37,12 +37,7 @@ private slots:
void _rcChannelsChanged(int channelCount, int pwmValues[Vehicle::cMaxRcChannels]);
private:
int _chanMax(void) const;
int _chanCount;
static const int _chanMaxPX4 = 18; ///< Maximum number of supported rc channels, PX4 Firmware
static const int _chanMaxAPM = 14; ///< Maximum number of supported rc channels, APM firmware
};
#endif // RCChannelMonitorController_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment