comparison Discovery/Src/tCCR.c @ 998:5a690195b6b7 GasConsumption

Added dual operation of scrubber timers: In the previous version only one scrubber timer could be selected for operation. In the new version the activation of both timers is possible. In that case both timers will be displayed as well. To enable this a new activation item has been added to the scrubber menu.
author Ideenmodellierer
date Wed, 23 Apr 2025 14:52:03 +0200
parents 7149f372b0ba
children 8c0134a287da
comparison
equal deleted inserted replaced
997:2f7531a8e922 998:5a690195b6b7
320 * data is considered old 320 * data is considered old
321 */ 321 */
322 void tCCR_tick(void) 322 void tCCR_tick(void)
323 { 323 {
324 SSettings* pSettings = settingsGetPointer(); 324 SSettings* pSettings = settingsGetPointer();
325 uint8_t timerId = 0;
325 326
326 if(pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_OPTIC) 327 if(pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_OPTIC)
327 { 328 {
328 if(HUDTimeoutCount < 3 * 10) 329 if(HUDTimeoutCount < 3 * 10)
329 HUDTimeoutCount++; 330 HUDTimeoutCount++;
344 { 345 {
345 ScrubberTimeoutCount++; 346 ScrubberTimeoutCount++;
346 if(ScrubberTimeoutCount >= 600) /* resolution is minutes */ 347 if(ScrubberTimeoutCount >= 600) /* resolution is minutes */
347 { 348 {
348 ScrubberTimeoutCount = 0; 349 ScrubberTimeoutCount = 0;
349 if(stateUsed->scrubberDataDive[pSettings->scubberActiveId].TimerCur > MIN_SCRUBBER_TIME) 350 for(timerId = 0; timerId < 2; timerId++)
350 { 351 {
351 stateUsedWrite->scrubberDataDive[pSettings->scubberActiveId].TimerCur--; 352 if(pSettings->scubberActiveId & (1 << timerId))
353 {
354 if(stateUsed->scrubberDataDive[timerId].TimerCur > MIN_SCRUBBER_TIME)
355 {
356 stateUsedWrite->scrubberDataDive[timerId].TimerCur--;
357 }
358 translateDate(stateUsed->lifeData.dateBinaryFormat, &stateUsedWrite->scrubberDataDive[timerId].lastDive);
359 }
352 } 360 }
353 translateDate(stateUsed->lifeData.dateBinaryFormat, &stateUsedWrite->scrubberDataDive[pSettings->scubberActiveId].lastDive);
354 } 361 }
355 } 362 }
356 } 363 }
357 } 364 }
358 365