Mercurial > public > ostc4
diff Discovery/Src/base.c @ 446:f1257a32f2d4 minor_improvments
Introduced configuration header for variant managment:
At the moment several defines are distributed across the code allowing special SW builds (e.g. logging simulated dives). To make these options more transparent and easier to configurate a separate header has been added. With this header an new option for an optical pressure sensor was introduced.
author | ideenmodellierer |
---|---|
date | Thu, 05 Mar 2020 22:31:50 +0100 |
parents | b1091e183d52 |
children | adc4ccbebbb5 |
line wrap: on
line diff
--- a/Discovery/Src/base.c Thu Mar 05 22:27:55 2020 +0100 +++ b/Discovery/Src/base.c Thu Mar 05 22:31:50 2020 +0100 @@ -199,6 +199,7 @@ /* Includes ------------------------------------------------------------------*/ #include "stdio.h" #include <string.h> // for memcopy +#include "configuration.h" #include "stm32f4xx_hal.h" #include "ostc.h" @@ -327,12 +328,6 @@ return(ch); } */ -/* #define DEBUG_RUNTIME TRUE */ -#ifdef DEBUG_RUNTIME -#define MEASURECNT 60 /* number of measuremets to be stored */ -static uint32_t loopcnt[MEASURECNT]; -#endif - static uint8_t ButtonAction = ACTION_END; static void StoreButtonAction(uint8_t action) @@ -350,11 +345,6 @@ { uint32_t pLayerInvisible; uint16_t totalDiveCounterFound; -#ifdef DEBUG_RUNTIME - RTC_TimeTypeDef Stime; - uint8_t measurementindex = 0; - uint8_t lastsecond = 0xFF; -#endif SStateList status; detectionState_t pitchstate; @@ -527,9 +517,6 @@ } -// Enable this to make the simulator write a logbook entry -// #define SIM_WRITES_LOGBOOK 1 - #ifdef SIM_WRITES_LOGBOOK if(stateUsed == stateSimGetPointer()) logbook_InitAndWrite(stateUsed); @@ -537,27 +524,6 @@ if(stateUsed == stateRealGetPointer()) /* Handle log entries while in dive mode*/ logbook_InitAndWrite(stateUsed); } - -#ifdef DEBUG_RUNTIME - translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime); - if(lastsecond == 0xFF) - { - measurementindex = 0; - loopcnt[measurementindex] = 0; - lastsecond = Stime.Seconds; - } - loopcnt[measurementindex]++; - - if(lastsecond != Stime.Seconds) - { - measurementindex++; - if (measurementindex == MEASURECNT) measurementindex = 0; - loopcnt[measurementindex] = 0; - lastsecond = Stime.Seconds; - if(measurementindex +1 < MEASURECNT) loopcnt[measurementindex +1] = 0xffff; /* helps to identify the latest value */ - } -#endif - } }