mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 23:43:34 +08:00
Port PX4 to BeagleBone Blue Board using library librobotcontrol instead of a submodule
This commit is contained in:
@@ -42,7 +42,8 @@ int RcInput::init()
|
||||
/**
|
||||
* initialize the data of each channel
|
||||
*/
|
||||
for (i = 0; i < input_rc_s::RC_INPUT_MAX_CHANNELS; ++i) {
|
||||
for (i = 0; i < input_rc_s::RC_INPUT_MAX_CHANNELS && i<16; ++i) {
|
||||
//_data.values defined as int[16] and RC_INPUT_MAX_CHANNELS (=18) > 16
|
||||
_data.values[i] = UINT16_MAX;
|
||||
}
|
||||
|
||||
@@ -104,7 +105,7 @@ int RcInput::start(char *device, int channels)
|
||||
{
|
||||
int result = 0;
|
||||
strcpy(_device, device);
|
||||
PX4_WARN("Device %s , channels: %d \n", device, channels);
|
||||
PX4_INFO("Device %s , channels: %d \n", device, channels);
|
||||
_channels = channels;
|
||||
result = init();
|
||||
|
||||
@@ -231,6 +232,7 @@ void RcInput::_measure(void)
|
||||
_data.rc_failsafe = (_sbusData[23] & (1 << 3)) ? true : false;
|
||||
_data.rc_lost = (_sbusData[23] & (1 << 2)) ? true : false;
|
||||
_data.input_source = input_rc_s::RC_INPUT_SOURCE_PX4IO_SBUS;
|
||||
|
||||
orb_publish(ORB_ID(input_rc), _rcinput_pub, &_data);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------//
|
||||
|
||||
Reference in New Issue
Block a user