platform node
This commit is contained in:
21
crossbow/platform_node.cpp
Normal file
21
crossbow/platform_node.cpp
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user