-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wireless temperature sensor initialization issue
- Loading branch information
Showing
1 changed file
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ce14288
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. There is one more issue though.
In
TempSensor.cpp
there must be a check placed at the start ofvoid TempSensor::update()
to ensure that an update cannot be done if the TempSensor object has not been fully initialized.Adding something like the following should fix it.
When a TempSensor() class object is instantiated,
failedReadCount
is set to -1 to indicate that it is not initialized. In voidTempSensor::init()
it is set tofailedReadCount = 0;
when sucessfully initialized. The problem still remains that whenvoid TempSensor::update()
is called, failedReadCount is incremented while the sensor is not initialized yet, leading to filter misbehaviour.