changeset 103:f5d2f02dc73f kittz

Generalize TEXT of pressure unit
author Dmitry Romanov <kitt@bk.ru>
date Wed, 28 Nov 2018 09:36:33 +0300
parents 4276d56eb37c
children 22a1094545f3
files Common/Inc/global_constants.h Discovery/Src/settings.c Discovery/Src/t7.c Discovery/Src/tMenuEditSystem.c Small_CPU/Src/baseCPU2.c ostc4pack/OSTC4_Firmware.bin ostc4pack/OSTC4_RTE.bin ostc4pack/OSTC4_RTE_upload.bin ostc4pack/OSTC4_firmware_upload.bin
diffstat 9 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/global_constants.h	Tue Nov 27 18:31:21 2018 +0100
+++ b/Common/Inc/global_constants.h	Wed Nov 28 09:36:33 2018 +0300
@@ -39,4 +39,8 @@
 //Spi sync data debug
 #define SPI_SHOW_SYNC_STATS 1
 #define SPI_MIN_ERROR_SHOW 2
+
+
+//Text data
+#define TEXT_PRESSURE_UNIT "hPa"
 #endif
--- a/Discovery/Src/settings.c	Tue Nov 27 18:31:21 2018 +0100
+++ b/Discovery/Src/settings.c	Wed Nov 28 09:36:33 2018 +0300
@@ -55,7 +55,7 @@
 {
     .versionFirst   = 1,
     .versionSecond 	= 4,
-    .versionThird   = 5,
+    .versionThird   = 2,
     .versionBeta    = 1,
 
     /* 4 bytes with trailing 0 */
--- a/Discovery/Src/t7.c	Tue Nov 27 18:31:21 2018 +0100
+++ b/Discovery/Src/t7.c	Wed Nov 28 09:36:33 2018 +0300
@@ -775,7 +775,7 @@
     /* surface pressure  and temperature */
     if(stateUsed->sensorErrorsRTE == 0)
     {
-        snprintf(text,30,"%01.0f\022\016\016 hPa", stateUsed->lifeData.pressure_surface_bar * 1000.0f);
+        snprintf(text,30,"%01.0f\022\016\016 %s", stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT);
         GFX_write_string(&FontT48,&t7surfaceL,text,3);
 
         if(settingsGetPointer()->nonMetricalSystem)
@@ -786,7 +786,7 @@
     }
     else
     {
-        snprintf(text,30,"ERR\022\016\016 hPa");
+        snprintf(text,30,"ERR\022\016\016 %s",TEXT_PRESSURE_UNIT);
         GFX_write_string(&FontT48,&t7surfaceL,text,3);
 
         if(settingsGetPointer()->nonMetricalSystem)
@@ -1090,7 +1090,7 @@
         Gfx_write_label_var(&t7screen,  0,400,255,&FontT48,CLUT_Font020,TextL1);
         return;
     }
-    snprintf(TextL1,TEXTSIZE,"%01.0f hPa",stateUsed->lifeData.pressure_ambient_bar * 1000.0f);
+    snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_ambient_bar * 1000.0f,TEXT_PRESSURE_UNIT);
     Gfx_write_label_var(&t7screen,  0,400,  0,&FontT42,CLUT_DiveMainLabel,"Ambient Pressure");
     Gfx_write_label_var(&t7screen,  0,400, 45,&FontT48,CLUT_Font020,TextL1);
 
@@ -1102,7 +1102,7 @@
     Gfx_write_label_var(&t7screen,  0,400,200,&FontT42,CLUT_DiveMainLabel,"Heading Roll Pitch");
     Gfx_write_label_var(&t7screen,  0,400,255,&FontT48,CLUT_Font020,TextL1);
 
-    snprintf(TextL1,TEXTSIZE,"%01.0f hPa",stateUsed->lifeData.pressure_surface_bar * 1000.0f);
+    snprintf(TextL1,TEXTSIZE,"%01.0f %s",stateUsed->lifeData.pressure_surface_bar * 1000.0f,TEXT_PRESSURE_UNIT);
     Gfx_write_label_var(&t7screen,  0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure");
     Gfx_write_label_var(&t7screen,  0,400,355,&FontT48,CLUT_Font020,TextL1);
 
--- a/Discovery/Src/tMenuEditSystem.c	Tue Nov 27 18:31:21 2018 +0100
+++ b/Discovery/Src/tMenuEditSystem.c	Wed Nov 28 09:36:33 2018 +0300
@@ -1237,7 +1237,7 @@
         write_label_var(  20, 800, ME_Y_LINE4, &FontT42, text_content);
 
         offsetTemperature = ((float)settingsGetPointer()->offsetTemperature_centigrad) / 10;
-        snprintf(text_content,80,"%i hPa  /  %0.2f\140C",settingsGetPointer()->offsetPressure_mbar, offsetTemperature);
+        snprintf(text_content,80,"%i %s  /  %0.2f\140C",settingsGetPointer()->offsetPressure_mbar, TEXT_PRESSURE_UNIT, offsetTemperature);
         write_label_var(  20, 800, ME_Y_LINE5, &FontT42, text_content);
 
         text_button[0] = TXT_2BYTE;
--- a/Small_CPU/Src/baseCPU2.c	Tue Nov 27 18:31:21 2018 +0100
+++ b/Small_CPU/Src/baseCPU2.c	Wed Nov 28 09:36:33 2018 +0300
@@ -165,7 +165,7 @@
 const SFirmwareData cpu2_FirmwareData __attribute__(( section(".firmware_data") ))= {
 		.versionFirst = 1,
 		.versionSecond = 5,
-		.versionThird = 2,
+		.versionThird = 1,
 		.versionBeta = 0,
 
 /* 4 bytes with trailing 0 */
Binary file ostc4pack/OSTC4_Firmware.bin has changed
Binary file ostc4pack/OSTC4_RTE.bin has changed
Binary file ostc4pack/OSTC4_RTE_upload.bin has changed
Binary file ostc4pack/OSTC4_firmware_upload.bin has changed