The default behavior of library managers are updating Bounce2 from 2.60 to 2.70, as they are not aware of a backwards-incompatible change to the API has taken place. See thomasfredericks/Bounce2#82.
This causes compile errors such as:
.pio\libdeps\adafruit_circuitplayground_m0\ButtonSuite\src\ButtonBase.cpp: In member function 'BUTTONSUITE::BUTTONSTATUS ButtonBase::update()':
.pio\libdeps\adafruit_circuitplayground_m0\ButtonSuite\src\ButtonBase.cpp:82:18: error: 'class Bounce' has no member named 'duration'
82 | if (_debouncer.duration() < _longPressInterval)
| ^~~~~~~~
Solution
Add duration back into the API, restoring backwards-compatibility, but mark it as deprecated.
Evidence
The following app, which depends on lendres/ButtonSuite (which in turn depends on Bounce2) gets a compile error using unpatched Bounce2 v2.70. When patched with this change, the app compiles and functions normally.
- adds back duration
- marks duration as deprecated
- updates docs by running doxygen
# Problem
The default behavior of library managers are updating Bounce2 from 2.60 to 2.70, as they are not aware of a backwards-incompatible change to the API has taken place. See thomasfredericks/Bounce2#82.
This causes compile errors such as:
```
.pio\libdeps\adafruit_circuitplayground_m0\ButtonSuite\src\ButtonBase.cpp: In member function 'BUTTONSUITE::BUTTONSTATUS ButtonBase::update()':
.pio\libdeps\adafruit_circuitplayground_m0\ButtonSuite\src\ButtonBase.cpp:82:18: error: 'class Bounce' has no member named 'duration'
82 | if (_debouncer.duration() < _longPressInterval)
| ^~~~~~~~
```
# Solution
Add duration back into the API, restoring backwards-compatibility, but mark it as deprecated.
# Evidence
The following app, which depends on lendres/ButtonSuite (which in turn depends on Bounce2) gets a compile error using unpatched Bounce2 v2.70. When patched with this change, the app compiles and functions normally.
platformio.ini
```
[env:adafruit_circuitplayground_m0]
platform = atmelsam
board = adafruit_circuitplayground_m0
framework = arduino
lib_deps =
adafruit/Adafruit NeoPixel@^1.10.4
thomasfredericks/Bounce2@^2.60
lendres/ButtonSuite@^2.1.0
```
main.cpp
```
#include <Arduino.h>
#include <MomentaryButton.h>
MomentaryButton button(4);
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
pinMode(4, INPUT_PULLDOWN);
}
void loop() {
if (button.pushed()) {
digitalWrite(13, HIGH);
}
else {
digitalWrite(13, LOW);
}
}
```
@thomasfredericks resolved in diff for #82 instead. Thanks!
@thomasfredericks resolved in [diff](https://github.com/thomasfredericks/Bounce2/commit/79db9f00168eaad226d37b72adb80a66c0f98ef8#diff-a44a64df20b3815624fe84ea8f06d066d9eb0140214fb55810a0774938839299) for #82 instead. Thanks!
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The default behavior of library managers are updating Bounce2 from 2.60 to 2.70, as they are not aware of a backwards-incompatible change to the API has taken place. See thomasfredericks/Bounce2#82.
This causes compile errors such as:
Solution
Add duration back into the API, restoring backwards-compatibility, but mark it as deprecated.
Evidence
The following app, which depends on lendres/ButtonSuite (which in turn depends on Bounce2) gets a compile error using unpatched Bounce2 v2.70. When patched with this change, the app compiles and functions normally.
platformio.ini
main.cpp
@thomasfredericks resolved in diff for #82 instead. Thanks!
Pull request closed