changeset 130:b7689d9e888a FlipDisplay

Minor changes to improved code quality and to eliminate warnings
author Ideenmodellierer
date Sun, 17 Feb 2019 21:22:13 +0100
parents 239aa58b533d
children f35e53ef04e0
files Discovery/Src/buehlmann.c Discovery/Src/logbook.c Discovery/Src/stm32f4xx_hal_msp_hw2.c Discovery/Src/t9.c Discovery/Src/tComm.c Discovery/Src/tInfo.c Discovery/Src/tMenu.c Discovery/Src/tMenuEditDeco.c Discovery/Src/tMenuEditHardware.c Discovery/Src/tMenuEditSetpoint.c
diffstat 10 files changed, 31 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/buehlmann.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/buehlmann.c	Sun Feb 17 21:22:13 2019 +0100
@@ -78,13 +78,12 @@
 
 SDecoinfo gDecotable;
 float gSurface_pressure_bar;
-
 float gPressure;
 int gGas_id;
 float gTTS;
 float gTissue_nitrogen_bar[16];
 float gTissue_helium_bar[16];
-float	gGF_value;
+float gGF_value;
 float gCNS;
 //float gMax_ceiling_bar = 0;
 int gNDL;
--- a/Discovery/Src/logbook.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/logbook.c	Sun Feb 17 21:22:13 2019 +0100
@@ -419,7 +419,7 @@
     eventByte1.uw = 0;
     eventByte2.uw = 0;
     //uint16_t tmpU16 = 0;
-		const SDecoinfo * pDecoinfo; // new hw 160620
+	const SDecoinfo * pDecoinfo; // new hw 160620
 
     //BuildEevntyte 1
 		// sub old 0-3 only one at a time
--- a/Discovery/Src/stm32f4xx_hal_msp_hw2.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/stm32f4xx_hal_msp_hw2.c	Sun Feb 17 21:22:13 2019 +0100
@@ -393,7 +393,7 @@
     GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;
     GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
-    GPIO_InitStruct.Speed = /* Decision is based on errata which recommends FAST for GPIO at 90Mhz */
+    GPIO_InitStruct.Speed = GPIO_SPEED_FAST; /* Decision is based on errata which recommends FAST for GPIO at 90Mhz */
     GPIO_InitStruct.Alternate = GPIO_AF5_SPI5;
     HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
 
@@ -502,6 +502,7 @@
         HAL_NVIC_SetPriority(TIMx_IRQn, 2, 1);
         HAL_NVIC_EnableIRQ(TIMx_IRQn);
     }
+#ifdef DEMOMODE
   if(htim_base->Instance==TIM7)
   {
     __TIM7_CLK_ENABLE();
@@ -509,6 +510,7 @@
         HAL_NVIC_SetPriority(TIM7_IRQn, 2, 0);
         HAL_NVIC_EnableIRQ(TIM7_IRQn);
     }
+#endif
 }
 
 void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm)
--- a/Discovery/Src/t9.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/t9.c	Sun Feb 17 21:22:13 2019 +0100
@@ -105,7 +105,7 @@
 
 S9Background t9_background =
 {
-    .pointer = NULL,
+    .pointer = 0,
 };
 
 /* Private types -------------------------------------------------------------*/
@@ -567,23 +567,28 @@
     const uint8_t *pViews;
 
     if(stateUsed->mode == MODE_DIVE)
+    {
         pViews = t9_customviewsDive;
+        while((*pViews != CVIEW_END) && (*pViews != t9_selection_customview))
+        	{pViews++;}
 
-    while((*pViews != CVIEW_END) && (*pViews != t9_selection_customview))
-        {pViews++;}
-
-    if(*pViews < CVIEW_END)
-        pViews++;
+		if(*pViews < CVIEW_END)
+			pViews++;
+		else
+		{
+			if(stateUsed->mode == MODE_DIVE)
+				pViews = t9_customviewsDive;
+		}
+		 t9_selection_customview = *pViews;
+    }
     else
     {
-        if(stateUsed->mode == MODE_DIVE)
-            pViews = t9_customviewsDive;
+    	t9_selection_customview = 0;
     }
-
 //	if((*pViews == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
 //		pViews++;
 
-    t9_selection_customview = *pViews;
+
 }
 
 
--- a/Discovery/Src/tComm.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/tComm.c	Sun Feb 17 21:22:13 2019 +0100
@@ -1610,6 +1610,7 @@
     uint32_t checksum, checksumCalc;
     uint8_t id;
 
+    checksumCalc = 0;
 
     //Get length
     if(HAL_UART_Receive(&UartHandle, sBuffer, 4,5000)!= HAL_OK) // 58000
--- a/Discovery/Src/tInfo.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/tInfo.c	Sun Feb 17 21:22:13 2019 +0100
@@ -256,6 +256,7 @@
     case ACTION_MODE_CHANGE:
     case ACTION_BUTTON_BACK:
         exitInfo();
+        break;
     default:
         break;
     case ACTION_IDLE_TICK:
--- a/Discovery/Src/tMenu.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/tMenu.c	Sun Feb 17 21:22:13 2019 +0100
@@ -1084,7 +1084,7 @@
         uint16_t al88;
     };
 
-    uint16_t* prunning = *ppDestination;
+    uint16_t* prunning = (uint16_t*)*ppDestination;
 
     union al88_u color_seperator;
     union al88_u color_unselected;
@@ -1107,7 +1107,7 @@
     *(__IO uint16_t*)prunning++ = color_seperator.al88;
     *(__IO uint16_t*)prunning++ = color_seperator.al88;
 
-    *ppDestination = prunning;
+    *ppDestination = (uint32_t)prunning;
 }
 
 
@@ -1247,7 +1247,7 @@
 
     pBackup = tMscreen.FBStartAdress;
     tMscreen.FBStartAdress = menu.StartAddressForPage[page];
-    pDestination = menu.StartAddressForPage[page];
+    pDestination = (uint16_t*) menu.StartAddressForPage[page];
     positionText = 10;
     pageText = page;
 
--- a/Discovery/Src/tMenuEditDeco.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/tMenuEditDeco.c	Sun Feb 17 21:22:13 2019 +0100
@@ -31,6 +31,7 @@
 
 #include "gfx_fonts.h"
 #include "tMenuEdit.h"
+#include "unit.h"
 
 /* Private variables ---------------------------------------------------------*/
 uint8_t lineSelected = 0;
--- a/Discovery/Src/tMenuEditHardware.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/tMenuEditHardware.c	Sun Feb 17 21:22:13 2019 +0100
@@ -35,7 +35,11 @@
 #include "ostc.h"
 #include "tCCR.h"
 #include "tMenuEdit.h"
+#include "tHome.h"
+#include "tInfo.h"
+#include "tInfoLog.h"
 
+extern void tM_build_pages(void);
 
 /* Private function prototypes -----------------------------------------------*/
 void openEdit_Bluetooth(void);
--- a/Discovery/Src/tMenuEditSetpoint.c	Sun Feb 17 21:14:09 2019 +0100
+++ b/Discovery/Src/tMenuEditSetpoint.c	Sun Feb 17 21:22:13 2019 +0100
@@ -72,6 +72,7 @@
     {
         uint8_t setpointCbar, actualGasID;
         SDiveState *pState;
+        setpointCbar = 100;
 
         if(actual_menu_content == MENU_DIVE_REAL)
             pState = stateRealGetPointerWrite();