# HG changeset patch # User Ideenmodellierer # Date 1678215090 -3600 # Node ID 4f19336a3f217844662060e511dc16bef3a0a3f6 # Parent 70e9c83ecf22e6e3ca4701dcb0e22387fcb81677 Dev Bugfix: Alignment problem in lifedata structure: Since the introduction of the 64 bit DigO2 sensor ID the potential risk of a misalignment is present in the lifedata structure. E.g. If a new 8bit variable is added in front of the data structure containing the 64bit value. To avoid this in future the sensor data structure which may contain the 64bit value has been moved to the top of the structure (first element) diff -r 70e9c83ecf22 -r 4f19336a3f21 Common/Inc/data_central.h --- a/Common/Inc/data_central.h Mon Mar 13 22:23:00 2023 +0100 +++ b/Common/Inc/data_central.h Tue Mar 07 19:51:30 2023 +0100 @@ -172,6 +172,9 @@ typedef struct { /* from Small CPU */ + uint8_t extIf_sensor_data[32]; /* The external sensor may contain a 64 bit ID. It has been placed at the beginning of the structure to avoid problems in alignment */ + uint8_t extIf_sensor_map[EXT_INTERFACE_SENSOR_CNT]; + int32_t dive_time_seconds; int32_t dive_time_seconds_without_surface_time; uint32_t surface_time_seconds; @@ -201,9 +204,6 @@ uint8_t buttonPICdata[4]; SCO2Sensor CO2_data; uint8_t extIf_sensor_Id; - uint8_t UINT64ALIGNMENT; /* If your program crash check if you changed something in the life data structure ! The external sensor may contain a 64 bit ID */ - uint8_t extIf_sensor_data[32]; - uint8_t extIf_sensor_map[EXT_INTERFACE_SENSOR_CNT]; /* by create DiveSettings() and by setActualGas() * is send to Small CPU2 for nitrogen calculation @@ -268,6 +268,7 @@ int8_t betterGas; int8_t fallback; int8_t betterSetpoint; + int8_t co2High; #ifdef ENABLE_BOTTLE_SENSOR int8_t newPressure; #endif