Skip to content

Commit

Permalink
Fixed issues with conditional jumps on uninitialized values in PeakDe…
Browse files Browse the repository at this point in the history
…tector.
  • Loading branch information
sofian committed Jan 4, 2025
1 parent 735dadf commit 47b5c47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PeakDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
namespace pq {

PeakDetector::PeakDetector(float triggerThreshold_, uint8_t mode_)
: DigitalUnit()
: DigitalUnit(),
_triggerThreshold(triggerThreshold_),
_reloadThreshold(triggerThreshold_),
_fallbackTolerance(0.1f),
_mode(PEAK_RISING) // will be reset properly when calling mode(mode_)
{
// Assign mode.
mode(mode_);
Expand Down

0 comments on commit 47b5c47

Please sign in to comment.