HAL_Linux: fixed build warnings in RC input methods

This commit is contained in:
Andrew Tridgell 2020-07-06 08:19:06 +10:00
parent 7138811a57
commit c5a60c31a7
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,7 @@ private:
int _fd;
uint8_t *_pdata;
ssize_t _remain;
struct PACKED {
struct {
uint16_t magic;
uint16_t values[CHANNELS];
} _data;

View File

@ -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);
}