Having trouble passing structured data between devices over RFM69 radio. I've narrowed down the problem to the same data structure having different sizes on the 2 different devices. With the structure declaration below, DriveData is 5 bytes on a Nano BUT 6 bytes on the Nano 33 iot ! The size of a temp variable declared to be unit16_t on the Nano 33 iot is 2 bytes as expected, so I'm not sure where the extra byte comes from. If I declare BattV to be unit8_t, then DriveData is 4 bytes on both devices, as expected - and all is well. If instead I declare BattV as an int, then DriveData is 12 bytes on the Nano 33 iot, and 5 bytes on the Nano. I have come to understand that the sizes of the various dat types differs on unique hardware, but if int is 8 bytes on the iot, then why is DriveData 12 instead of 11 bytes? I have scaled my data to get by with a single byte in this case but this wont always be satisfactory. What is it that I don't know?
typedef struct {
byte DW;
uint16_t BattV;
byte Hr;
byte Min;
} DWDataStructure;
DWDataStructure DriveData;