Fixed RefCountedDigitalPin.h to release claim correctly to save back 26mA#1569
Conversation
…gative claims number.
|
Hi @IoTThinks ,Thank you for your hard work, but we believe that #1570 is the correct reason. |
|
Ok, let me try yours. If your PR works then I will close this PR as you have clearer picture than I. |
|
Ho this is working? Will this code stay on on Heltec v3 +v4 platforms or this code also will impact my PicoW variant? I don't have OLED display and possibly use this GPIO pin for things... |
@JDat If you don't have OLED, this issue will not happen to you. However, the OLED and sensors need to use claim() and release(). So no impact for you. |
|
I will keep this PR for review. The release() function should work correctly on its own. |
|
LGTM. Nice and clean and a generic fix for other use cases as well. |
Hi friends,
This is to fix RefCountedDigitalPin.h to release claim correctly and to ensure no negative "claims" number.
Without this, Heltec v4 comsumes extra 26mA in normal mode and in power saving mode when the power to OLED does not cut off in turnOff correctly.
Tested working fine on Heltec v3 and v4.
It should be fine for other boards too.