From ea6147162aab8e98a11b730855daafe8e8841e4f Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 9 Jan 2013 17:19:12 -0800 Subject: [PATCH] AP_HAL_SMACCM: fix to goofed PPM_MAX_CHANNELS macro --- libraries/AP_HAL_SMACCM/RCInput.cpp | 6 +++--- libraries/AP_HAL_SMACCM/RCInput.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL_SMACCM/RCInput.cpp b/libraries/AP_HAL_SMACCM/RCInput.cpp index a1d0bcd4fa..2b70bccf2e 100644 --- a/libraries/AP_HAL_SMACCM/RCInput.cpp +++ b/libraries/AP_HAL_SMACCM/RCInput.cpp @@ -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; } diff --git a/libraries/AP_HAL_SMACCM/RCInput.h b/libraries/AP_HAL_SMACCM/RCInput.h index 5ae531fab2..495e6f719d 100644 --- a/libraries/AP_HAL_SMACCM/RCInput.h +++ b/libraries/AP_HAL_SMACCM/RCInput.h @@ -4,6 +4,8 @@ #include +#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__