changeset 819:24b39a432bc2

Added debug information in case an error in the settings has been detected: The "Check Settings" warning now provides the index of the first parameter which has been corrected as well as the number of corrections.
author Ideenmodellierer
date Sun, 24 Sep 2023 18:39:26 +0200
parents 40e951cfa443
children 7322adb00305
files Common/Inc/settings.h Discovery/Src/t7.c
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/settings.h	Thu Sep 14 13:24:30 2023 +0200
+++ b/Common/Inc/settings.h	Sun Sep 24 18:39:26 2023 +0200
@@ -176,6 +176,11 @@
     SETPOINT_INDEX_AUTO_DECO,
 };
 
+typedef struct
+{
+	uint8_t FirstCorrection;
+	uint8_t Corrections;
+} SSettingsStatus;
 
 /* SSettings
 	 * gas[0] and setpoint[0] are the special ones configurable during the dive
@@ -381,6 +386,7 @@
 uint8_t settingsHelperButtonSens_translate_percentage_to_hwOS_values(uint8_t inputValuePercentage);
 uint8_t settingsHelperButtonSens_translate_hwOS_values_to_percentage(uint8_t inputValuePIC);
 
+void get_CorrectionStatus(SSettingsStatus* Status);
 void reset_SettingWarning();
 uint8_t isSettingsWarning();
 
--- a/Discovery/Src/t7.c	Thu Sep 14 13:24:30 2023 +0200
+++ b/Discovery/Src/t7.c	Sun Sep 24 18:39:26 2023 +0200
@@ -2160,7 +2160,7 @@
     const SGasLine * pGasLine; // CVIEW_Gaslist
     uint8_t oxygen, helium; // CVIEW_Gaslist
     float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime
-
+    SSettingsStatus SettingsStatus;
 	SSettings* pSettings;
 	pSettings = settingsGetPointer();
 
@@ -2266,15 +2266,11 @@
 		{
             if(warning_count_high_time)
             {
+            	get_CorrectionStatus(&SettingsStatus);
                 shiftWindowY0 += 20;
                 t7cC.WindowY0 -= shiftWindowY0;
                 textpointer = 0;
-                text[textpointer++] = '\001';
-                text[textpointer++] = TXT_2BYTE;
-                text[textpointer++] = TXT2BYTE_CheckSettings;
-                text[textpointer++] = '\n';
-                text[textpointer++] = '\r';
-                text[textpointer++] = 0;
+                snprintf(text,255,"\001%c%c\n\r\001%d|%d",TXT_2BYTE,TXT2BYTE_CheckSettings,SettingsStatus.FirstCorrection,SettingsStatus.Corrections);
                 GFX_write_string_color(&FontT42,&t7cC,text,1, CLUT_WarningRed);
                 t7cC.WindowY0 += shiftWindowY0;
             }