ardupilot/libraries/AP_HAL_SITL/RCInput.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
652 B
C++
Raw Permalink Normal View History

#include <AP_HAL/AP_HAL.h>
#include <AP_RCProtocol/AP_RCProtocol_config.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL && AP_RCPROTOCOL_ENABLED
2012-12-17 23:56:21 -04:00
#include "RCInput.h"
#include <AP_RCProtocol/AP_RCProtocol.h>
2012-12-17 23:56:21 -04:00
using namespace HALSITL;
2012-12-17 23:56:21 -04:00
extern const AP_HAL::HAL& hal;
void RCInput::init()
2012-12-17 23:56:21 -04:00
{
AP::RC().init();
2012-12-17 23:56:21 -04:00
}
bool RCInput::new_input()
{
return AP::RC().new_input();
2012-12-17 23:56:21 -04:00
}
uint16_t RCInput::read(uint8_t ch)
{
return AP::RC().read(ch);
2012-12-17 23:56:21 -04:00
}
uint8_t RCInput::read(uint16_t* periods, uint8_t len)
{
AP::RC().read(periods, len);
return MIN(len, num_channels());
2012-12-17 23:56:21 -04:00
}
2018-07-23 23:46:31 -03:00
uint8_t RCInput::num_channels()
{
return AP::RC().num_channels();
2018-07-23 23:46:31 -03:00
}
2012-12-18 05:04:47 -04:00
#endif