Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on display when CO2 values rises limits #80

Open
Coscolin opened this issue Jan 17, 2022 · 2 comments
Open

Turn on display when CO2 values rises limits #80

Coscolin opened this issue Jan 17, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Coscolin
Copy link
Contributor

During battery operation, if user has selected display automatic turn off after X seconds it could be neccesary turn on display if measures rise to high values.

I think it could be turn on when measures increase or decrease 50 or 100 ppm from last value displayed, and turn it off again after X seconds.

When measures are at upper high risk limit, it could be neccesary to show values at least once time every 10 minutes, although don't change values.

Security must be more than battery optimization.

@melkati melkati added the enhancement New feature or request label Jan 12, 2024
@Coscolin
Copy link
Contributor Author

Coscolin commented Feb 1, 2024

Using bufferLoop() we can include a call to function:

void IRAM_ATTR buttonUpISR() {
    if (actualDisplayBrightness == 0)  // Turn on the display only if it's OFF
    {
#if defined(SUPPORT_OLED) || defined(SUPPORT_TFT)
        setDisplayBrightness(DisplayBrightness);  // Turn on the display at DisplayBrightness brightness
#endif
        lastTimeButtonPressed = millis();
    }
}

in CO2_Gadget_Buttons.h to turn on display when CO2 values rises limits.
This call only change lastTimeButtonPressed value to turn on display if it's off

@melkati
Copy link
Owner

melkati commented Feb 1, 2024

Good idea.

We must think about it, as there are some things planned to implement (as display management) that can collide with the buttons.

Anyway, probably we should not call this function directly as it's an ISR (interrupt service routine) and should only be called by a hardware interrupt (but we can duplicate the functionality on another similar one, no problem).

Let's talk about it later, when display management functionality is done...

Also, it must be after finish #154 as it also needs buttons to stop buzzer beeping.

Probably we should think of a generic way to stop an "abnormality" by briefly pressing a button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants