mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
AP_HAL_SMACCM: fix to goofed PPM_MAX_CHANNELS macro
This commit is contained in:
parent
2dd757a20f
commit
ea6147162a
@ -32,7 +32,7 @@ void SMACCMRCInput::init(void *unused)
|
|||||||
uint8_t SMACCMRCInput::valid()
|
uint8_t SMACCMRCInput::valid()
|
||||||
{
|
{
|
||||||
// If any of the overrides are positive, we have valid data.
|
// 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)
|
if (_override[i] > 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ bool SMACCMRCInput::set_override(uint8_t channel, int16_t override)
|
|||||||
if (override < 0)
|
if (override < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (channel < PPM_MAX_CHANNELS) {
|
if (channel < SMACCM_RCINPUT_CHANNELS) {
|
||||||
_override[channel] = override;
|
_override[channel] = override;
|
||||||
if (override != 0) {
|
if (override != 0) {
|
||||||
return true;
|
return true;
|
||||||
@ -100,7 +100,7 @@ bool SMACCMRCInput::set_override(uint8_t channel, int16_t override)
|
|||||||
|
|
||||||
void SMACCMRCInput::clear_overrides()
|
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;
|
_override[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include <AP_HAL_SMACCM.h>
|
#include <AP_HAL_SMACCM.h>
|
||||||
|
|
||||||
|
#define SMACCM_RCINPUT_CHANNELS 8
|
||||||
|
|
||||||
class SMACCM::SMACCMRCInput : public AP_HAL::RCInput {
|
class SMACCM::SMACCMRCInput : public AP_HAL::RCInput {
|
||||||
public:
|
public:
|
||||||
SMACCMRCInput();
|
SMACCMRCInput();
|
||||||
@ -17,7 +19,7 @@ public:
|
|||||||
void clear_overrides();
|
void clear_overrides();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint16_t _override[PPM_MAX_CHANNELS];
|
uint16_t _override[SMACCM_RCINPUT_CHANNELS];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __AP_HAL_SMACCM_RCINPUT_H__
|
#endif // __AP_HAL_SMACCM_RCINPUT_H__
|
||||||
|
Loading…
Reference in New Issue
Block a user