changeset 193:255326edf00b div-fixes-cleanup-1

Bugfix: show proper dive mode The dive mode shown in the top line on the display was strange. It could only show CCR and OC, and dive modes Apnea and Gauge where shown as OC. With this commit, the proper dive mode is shown. Notice that these strings/abbreviations where not localized, and are still not localized with this commit. The localized names from the corresponding menu lines are not really usable (as too long) to shown in the header. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Sat, 16 Mar 2019 21:52:06 +0100
parents a61b46a5265b
children f23b9055436f
files Discovery/Src/t7.c
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Sat Mar 16 21:08:18 2019 +0100
+++ b/Discovery/Src/t7.c	Sat Mar 16 21:52:06 2019 +0100
@@ -68,7 +68,7 @@
 
 uint8_t t7_customtextPrepare(char * text);
 
-/* Importend function prototypes ---------------------------------------------*/
+/* Imported function prototypes ---------------------------------------------*/
 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
 
 /* Exported variables --------------------------------------------------------*/
@@ -1016,11 +1016,22 @@
     }
 
     /* dive mode */
-    if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
-        GFX_write_string(&FontT24,&t7c1,"\f\002" "CCR",0);
-    else
-        GFX_write_string(&FontT24,&t7c1,"\f\002" "OC",0);
-//		GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80" "CCR",0);
+	switch (stateUsed->diveSettings.diveMode) {
+	case DIVEMODE_CCR:
+		GFX_write_string(&FontT24, &t7c1, "\f\002" "CCR", 0);
+		break;
+	case DIVEMODE_OC:
+		GFX_write_string(&FontT24, &t7c1, "\f\002" "OC", 0);
+		break;
+	case DIVEMODE_Gauge:
+		GFX_write_string(&FontT24, &t7c1, "\f\002" "Gauge", 0);
+		break;
+	case DIVEMODE_Apnea:
+		GFX_write_string(&FontT24, &t7c1, "\f\002" "Apnea", 0);
+		break;
+	default:
+		GFX_write_string(&FontT24, &t7c1, "\f\002" "OC", 0);
+	}
 
     /*battery */