khoih-prog / ESP_DoubleResetDetector

ESP_DoubleResetDetector is a library for the ESP32/ESP8266 Arduino platform to enable trigger configure mode by resetting twice.
MIT License
49 stars 18 forks source link

Sign compare warning #8

Closed reneverschoor closed 3 years ago

reneverschoor commented 3 years ago

ESP_DoubleResetDetector 1.1.0 PlatformIO version 5.0.3 Espressif 8266 2.6.2

In file included from include/reset.h:16:0,
                 from src/reset.cpp:1:
.pio/libdeps/d1_mini/ESP_DoubleResetDetector/src/ESP_DoubleResetDetector.h: In member function 'void DoubleResetDetector::loop()':
.pio/libdeps/d1_mini/ESP_DoubleResetDetector/src/ESP_DoubleResetDetector.h:184:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (waitingForDoubleReset && millis() > timeout)
                                               ^

Changing the private int timeout in ESP_DoubleResetDetector.h to e.g. an uint solves the warning.

khoih-prog commented 3 years ago

You can use it normally even with the warning. Will clean up all possible warnings in next release.

Thanks.