From f56a9a2c43efd79aefbc5bdd93e92cee423fa8ed Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Thu, 20 Oct 2022 00:53:05 +0200 Subject: [PATCH] compiler warning fixes and stupid cast for ESP toolchain --- IO_DFPlayer.h | 2 +- IO_HCSR04.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IO_DFPlayer.h b/IO_DFPlayer.h index 575668b..c60d116 100644 --- a/IO_DFPlayer.h +++ b/IO_DFPlayer.h @@ -161,7 +161,7 @@ protected: uint8_t pin = vpin - _firstVpin; // Validate parameter. - volume = min(30,volume); + volume = min((uint8_t)30,volume); if (pin == 0) { // Play track diff --git a/IO_HCSR04.h b/IO_HCSR04.h index d56dda3..e7b5622 100644 --- a/IO_HCSR04.h +++ b/IO_HCSR04.h @@ -138,7 +138,7 @@ private: // void read_HCSR04device() { // uint16 enough to time up to 65ms - uint16_t startTime, waitTime, currentTime, maxTime; + uint16_t startTime, waitTime = 0, currentTime, maxTime; // If receive pin is still set on from previous call, abort the read. if (ArduinoPins::fastReadDigital(_echoPin)) @@ -186,4 +186,4 @@ private: }; -#endif //IO_HCSR04_H \ No newline at end of file +#endif //IO_HCSR04_H