Mercurial > public > ostc4
comparison Discovery/Src/tCCR.c @ 758:b6d8a6fbf4fd
- Colours for scrubber display when time remaining falls below a threshold value
- Display negative values when time is up and diving continues;
- count down remaining scrubber time only when the dive computer is not set to bailout - after all, there is not much point in counting down time if the diver is not breathing through the scrubber.
author | heinrichsweikamp |
---|---|
date | Wed, 15 Mar 2023 09:18:07 +0100 |
parents | 39ff186b6f98 |
children | 9a1bb9e7cb61 |
comparison
equal
deleted
inserted
replaced
757:39ff186b6f98 | 758:b6d8a6fbf4fd |
---|---|
335 else | 335 else |
336 tCCR_fallbackToFixedSetpoint(); | 336 tCCR_fallbackToFixedSetpoint(); |
337 } | 337 } |
338 } | 338 } |
339 | 339 |
340 /* decrease scrubber timer only in real dive mode */ | 340 /* decrease scrubber timer only in real dive mode, and if we are not bailed out */ |
341 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (isLoopMode(pSettings->dive_mode)) && (stateUsed->mode == MODE_DIVE)) // && (stateUsed == stateRealGetPointer())) | 341 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (isLoopMode(pSettings->dive_mode)) && (stateUsed->mode == MODE_DIVE) && isLoopMode(stateUsed->diveSettings.diveMode)) // && (stateUsed == stateRealGetPointer())) |
342 { | 342 { |
343 ScrubberTimeoutCount++; | 343 ScrubberTimeoutCount++; |
344 if(ScrubberTimeoutCount >= 600) /* resolution is minutes */ | 344 if(ScrubberTimeoutCount >= 600) /* resolution is minutes */ |
345 { | 345 { |
346 ScrubberTimeoutCount = 0; | 346 ScrubberTimeoutCount = 0; |
347 if(pSettings->scrubberData[pSettings->scubberActiveId].TimerCur > 0) | 347 if(pSettings->scrubberData[pSettings->scubberActiveId].TimerCur > MIN_SCRUBBER_TIME) |
348 { | 348 { |
349 pSettings->scrubberData[pSettings->scubberActiveId].TimerCur--; | 349 pSettings->scrubberData[pSettings->scubberActiveId].TimerCur--; |
350 } | 350 } |
351 translateDate(stateUsed->lifeData.dateBinaryFormat, &pSettings->scrubberData[pSettings->scubberActiveId].lastDive); | 351 translateDate(stateUsed->lifeData.dateBinaryFormat, &pSettings->scrubberData[pSettings->scubberActiveId].lastDive); |
352 } | 352 } |