Files
QuadMeUp_Crossbow/crossbow/platform_node.cpp
Pawel Spychalski 5ff36034b8 platform node
2018-05-17 14:13:41 +02:00

21 lines
572 B
C++

#include "platform_node.h"
PlatformNode::PlatformNode(void) {
for (uint8_t i = 0; i < PLATFORM_TOTAL_CHANNEL_COUNT; i++) {
_channels[i] = PLATFORM_DEFAULT_CHANNEL_VALUE;
}
}
int PlatformNode::getRcChannel(uint8_t channel) {
if (channel < PLATFORM_TOTAL_CHANNEL_COUNT) {
return _channels[channel];
} else {
return PLATFORM_DEFAULT_CHANNEL_VALUE;
}
}
void PlatformNode::setRcChannel(uint8_t channel, int value, int offset) {
if (channel < PLATFORM_TOTAL_CHANNEL_COUNT) {
_channels[channel] = value + offset;
}
}