From a850f9f1ab55b71c28fcd0cbae40b58600a3c773 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Thu, 15 Apr 2021 21:24:26 +0200 Subject: [PATCH] Removed packed attribute from rtx and radio state data structures as they can cause crashes due to unaligned memory accesses. --- openrtx/include/rtx.h | 2 +- openrtx/include/state.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openrtx/include/rtx.h b/openrtx/include/rtx.h index 2b382441..88675c10 100644 --- a/openrtx/include/rtx.h +++ b/openrtx/include/rtx.h @@ -46,7 +46,7 @@ typedef struct uint16_t txToneEn : 1, /**< TX CTC/DCS tone enable */ txTone : 15; /**< TX CTC/DCS tone */ } -__attribute__((packed)) rtxStatus_t; +rtxStatus_t; /** * \enum bandwidth Enumeration type defining the current rtx bandwidth. diff --git a/openrtx/include/state.h b/openrtx/include/state.h index 3217887a..786ae1f8 100644 --- a/openrtx/include/state.h +++ b/openrtx/include/state.h @@ -37,7 +37,7 @@ typedef struct uint16_t azimuth; // Azimuth in degrees uint8_t snr; // Quality of the signal in range 0-99 } -__attribute__((packed)) sat_t; +sat_t; /** * Data structure representing the last state received from the GPS module. @@ -58,7 +58,7 @@ typedef struct float tmg_mag; // Course over ground, degrees, magnetic float tmg_true; // Course over ground, degrees, true } -__attribute__((packed)) gps_t; +gps_t; /** * Part of this structure has been commented because the corresponding @@ -96,7 +96,7 @@ typedef struct settings_t settings; gps_t gps_data; } -__attribute__((packed)) state_t; +state_t; enum TunerMode {