From c631201b907b42d01c5baba9d5394f965bac1057 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Tue, 12 Dec 2023 20:58:24 -0700 Subject: [PATCH] Added packed attribute to structs --- fc.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fc.ino b/fc.ino index fb0e1ef..7ebe4b2 100644 --- a/fc.ino +++ b/fc.ino @@ -34,26 +34,26 @@ int read_line = 22; int rx2 = 16; int tx2 = 17; -typedef struct { +typedef struct __attribute__((packed)) { uint8_t type; uint8_t controller_version; uint8_t unknown[12]; uint16_t crc; } pkt_init_t; -typedef struct { +typedef struct __attribute__((packed)) { uint8_t type; uint8_t unknown[13]; uint16_t crc; } pkt_init_resp_t; -typedef struct { +typedef struct __attribute__((packed)) { uint8_t type; uint8_t unknown[13]; uint16_t crc; } pkt_init_2_t; -typedef struct { +typedef struct __attribute__((packed)) { uint8_t type; uint8_t ack_type; uint8_t unknown_1; @@ -63,7 +63,7 @@ typedef struct { uint16_t crc; } pkt_ack_t; -typedef struct { +typedef struct __attribute__((packed)) { uint8_t type; uint8_t unknown[29]; uint16_t crc;