Skip to content

Conversation

@Shuhangtan
Copy link
Contributor

Added leakage detection in powerManagement.c

@poornack poornack changed the title Add files via upload Add Housing Monitor Jul 9, 2020
void housingMonitor_run(void)
{
housingMonitor_housing_E housing = Main;
if (housingMonitor_getHousingStatus(housing) == Leak)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the ADC value goes above the threshold, then back down, we want to latch the housing status to leak in case the water is just sloshing around in the housing.
My recommendation is to have a variable in this module's data struct that holds the housing status. Update it every time housingMonitor_run is run. When housingMonitor_getHousingStatus is called by another file, just return the value of that variable.

Modified the code according to ccomments
@anijjar
Copy link
Contributor

anijjar commented Aug 20, 2020

Has this PR been merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants