From c5a60c31a76fb07236f75fbbab357d8d454f4e48 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 6 Jul 2020 08:19:06 +1000 Subject: [PATCH] HAL_Linux: fixed build warnings in RC input methods --- libraries/AP_HAL_Linux/RCInput_UART.h | 2 +- libraries/AP_HAL_Linux/RCInput_UDP.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_Linux/RCInput_UART.h b/libraries/AP_HAL_Linux/RCInput_UART.h index fbbfd015ca..a1ba1fdc06 100644 --- a/libraries/AP_HAL_Linux/RCInput_UART.h +++ b/libraries/AP_HAL_Linux/RCInput_UART.h @@ -22,7 +22,7 @@ private: int _fd; uint8_t *_pdata; ssize_t _remain; - struct PACKED { + struct { uint16_t magic; uint16_t values[CHANNELS]; } _data; diff --git a/libraries/AP_HAL_Linux/RCInput_UDP.cpp b/libraries/AP_HAL_Linux/RCInput_UDP.cpp index 9258a9e488..021d01b933 100644 --- a/libraries/AP_HAL_Linux/RCInput_UDP.cpp +++ b/libraries/AP_HAL_Linux/RCInput_UDP.cpp @@ -79,5 +79,7 @@ void RCInput_UDP::_timer_tick(void) _last_buf_ts = _buf.timestamp_us; _last_buf_seq = _buf.sequence; - _update_periods(_buf.pwms, n_channels); + uint16_t pwms[n_channels]; + memcpy(pwms, _buf.pwms, n_channels*sizeof(uint16_t)); + _update_periods(pwms, n_channels); }