AP_HAL_SMACCM: fix to goofed PPM_MAX_CHANNELS macro

This commit is contained in:
Pat Hickey 2013-01-09 17:19:12 -08:00
parent 2dd757a20f
commit ea6147162a
2 changed files with 6 additions and 4 deletions

View File

@ -32,7 +32,7 @@ void SMACCMRCInput::init(void *unused)
uint8_t SMACCMRCInput::valid()
{
// If any of the overrides are positive, we have valid data.
for (int i = 0; i < PPM_MAX_CHANNELS; ++i)
for (int i = 0; i < SMACCM_RCINPUT_CHANNELS; ++i)
if (_override[i] > 0)
return true;
@ -88,7 +88,7 @@ bool SMACCMRCInput::set_override(uint8_t channel, int16_t override)
if (override < 0)
return false;
if (channel < PPM_MAX_CHANNELS) {
if (channel < SMACCM_RCINPUT_CHANNELS) {
_override[channel] = override;
if (override != 0) {
return true;
@ -100,7 +100,7 @@ bool SMACCMRCInput::set_override(uint8_t channel, int16_t override)
void SMACCMRCInput::clear_overrides()
{
for (int i = 0; i < PPM_MAX_CHANNELS; ++i)
for (int i = 0; i < SMACCM_RCINPUT_CHANNELS; ++i)
_override[i] = 0;
}

View File

@ -4,6 +4,8 @@
#include <AP_HAL_SMACCM.h>
#define SMACCM_RCINPUT_CHANNELS 8
class SMACCM::SMACCMRCInput : public AP_HAL::RCInput {
public:
SMACCMRCInput();
@ -17,7 +19,7 @@ public:
void clear_overrides();
private:
uint16_t _override[PPM_MAX_CHANNELS];
uint16_t _override[SMACCM_RCINPUT_CHANNELS];
};
#endif // __AP_HAL_SMACCM_RCINPUT_H__