diff options
author | Daniel Shiels <diyd5@tofubar.com> | 2014-11-10 16:34:28 +1100 |
---|---|---|
committer | Daniel Shiels <diyd5@tofubar.com> | 2014-11-10 16:34:28 +1100 |
commit | 3eeec2cce05c8f32a5c2d70b956786d41114df3c (patch) | |
tree | babf002bf96071acfd31bf1f2212052cdbdb6afd /src/modules/px4iofirmware/sbus.c | |
parent | 34e9d9efce10ce487b4c5af0cf93a442ab3b8594 (diff) | |
download | px4-firmware-3eeec2cce05c8f32a5c2d70b956786d41114df3c.tar.gz px4-firmware-3eeec2cce05c8f32a5c2d70b956786d41114df3c.tar.bz2 px4-firmware-3eeec2cce05c8f32a5c2d70b956786d41114df3c.zip |
Cleaned up sbus output frame initialisation.
Diffstat (limited to 'src/modules/px4iofirmware/sbus.c')
-rw-r--r-- | src/modules/px4iofirmware/sbus.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/modules/px4iofirmware/sbus.c b/src/modules/px4iofirmware/sbus.c index 90c0e0503..d76ec55f0 100644 --- a/src/modules/px4iofirmware/sbus.c +++ b/src/modules/px4iofirmware/sbus.c @@ -84,7 +84,6 @@ static hrt_abstime last_frame_time; static hrt_abstime last_txframe_time = 0; static uint8_t frame[SBUS_FRAME_SIZE]; -static uint8_t oframe[SBUS_FRAME_SIZE]; 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 offset = 0; uint16_t value; - hrt_abstime now; - oframe[0] = 0x0f; + hrt_abstime now; now = hrt_absolute_time(); if ((now - last_txframe_time) > SBUS1_FRAME_DELAY) { last_txframe_time = now; - - for (uint16_t i = 1; i < SBUS_FRAME_SIZE; ++i) { - oframe[i] = 0; - } + uint8_t oframe[SBUS_FRAME_SIZE] = { 0x0f }; /* 16 is sbus number of servos/channels minus 2 single bit channels. * currently ignoring single bit channels. */ |