mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 13:23:35 +08:00
Cleaned up sbus output frame initialisation.
This commit is contained in:
@@ -84,7 +84,6 @@ static hrt_abstime last_frame_time;
|
|||||||
static hrt_abstime last_txframe_time = 0;
|
static hrt_abstime last_txframe_time = 0;
|
||||||
|
|
||||||
static uint8_t frame[SBUS_FRAME_SIZE];
|
static uint8_t frame[SBUS_FRAME_SIZE];
|
||||||
static uint8_t oframe[SBUS_FRAME_SIZE];
|
|
||||||
|
|
||||||
static unsigned partial_frame_count;
|
static unsigned partial_frame_count;
|
||||||
|
|
||||||
@@ -128,17 +127,13 @@ sbus1_output(uint16_t *values, uint16_t num_values)
|
|||||||
uint8_t byteindex = 1; /*Data starts one byte into the sbus frame. */
|
uint8_t byteindex = 1; /*Data starts one byte into the sbus frame. */
|
||||||
uint8_t offset = 0;
|
uint8_t offset = 0;
|
||||||
uint16_t value;
|
uint16_t value;
|
||||||
hrt_abstime now;
|
hrt_abstime now;
|
||||||
oframe[0] = 0x0f;
|
|
||||||
|
|
||||||
now = hrt_absolute_time();
|
now = hrt_absolute_time();
|
||||||
|
|
||||||
if ((now - last_txframe_time) > SBUS1_FRAME_DELAY) {
|
if ((now - last_txframe_time) > SBUS1_FRAME_DELAY) {
|
||||||
last_txframe_time = now;
|
last_txframe_time = now;
|
||||||
|
uint8_t oframe[SBUS_FRAME_SIZE] = { 0x0f };
|
||||||
for (uint16_t i = 1; i < SBUS_FRAME_SIZE; ++i) {
|
|
||||||
oframe[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 16 is sbus number of servos/channels minus 2 single bit channels.
|
/* 16 is sbus number of servos/channels minus 2 single bit channels.
|
||||||
* currently ignoring single bit channels. */
|
* currently ignoring single bit channels. */
|
||||||
|
|||||||
Reference in New Issue
Block a user