mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-02 14:13:42 -04:00
c3a03a91bf
This commit changes the way libraries headers are included in source files: - If the header is in the same directory the source belongs to, so the notation '#include ""' is used with the path relative to the directory containing the source. - If the header is outside the directory containing the source, then we use the notation '#include <>' with the path relative to libraries folder. Some of the advantages of such approach: - Only one search path for libraries headers. - OSs like Windows may have a better lookup time.
50 lines
995 B
C++
50 lines
995 B
C++
#include <AP_HAL/AP_HAL.h>
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
|
|
|
#include "RCOutput.h"
|
|
|
|
using namespace HALSITL;
|
|
|
|
void SITLRCOutput::init(void* machtnichts) {}
|
|
|
|
void SITLRCOutput::set_freq(uint32_t chmask, uint16_t freq_hz) {
|
|
_freq_hz = freq_hz;
|
|
}
|
|
|
|
uint16_t SITLRCOutput::get_freq(uint8_t ch) {
|
|
return _freq_hz;
|
|
}
|
|
|
|
void SITLRCOutput::enable_ch(uint8_t ch)
|
|
{}
|
|
|
|
void SITLRCOutput::disable_ch(uint8_t ch)
|
|
{}
|
|
|
|
void SITLRCOutput::write(uint8_t ch, uint16_t period_us)
|
|
{
|
|
if (ch < SITL_NUM_CHANNELS) {
|
|
_sitlState->pwm_output[ch] = period_us;
|
|
}
|
|
}
|
|
|
|
void SITLRCOutput::write(uint8_t ch, uint16_t* period_us, uint8_t len)
|
|
{
|
|
memcpy(_sitlState->pwm_output+ch, period_us, len*sizeof(uint16_t));
|
|
}
|
|
|
|
uint16_t SITLRCOutput::read(uint8_t ch)
|
|
{
|
|
if (ch < SITL_NUM_CHANNELS) {
|
|
return _sitlState->pwm_output[ch];
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void SITLRCOutput::read(uint16_t* period_us, uint8_t len)
|
|
{
|
|
memcpy(period_us, _sitlState->pwm_output, len*sizeof(uint16_t));
|
|
}
|
|
|
|
#endif
|