platform node

This commit is contained in:
Pawel Spychalski
2018-05-17 14:13:41 +02:00
parent e915f30f1f
commit 5ff36034b8
10 changed files with 84 additions and 75 deletions

View File

@@ -0,0 +1,21 @@
#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;
}
}