Skip to content

Commit

Permalink
Merge pull request adafruit#6743 from Sciss/patch-1
Browse files Browse the repository at this point in the history
Touchin.c - fix clean up in constructor before exception is thrown
  • Loading branch information
dhalbert authored Aug 11, 2022
2 parents 5a2d870 + 92231e8 commit d645e9c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions shared-module/touchio/TouchIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void common_hal_touchio_touchin_construct(touchio_touchin_obj_t *self, const mcu

uint16_t raw_reading = get_raw_reading(self);
if (raw_reading == TIMEOUT_TICKS) {
common_hal_touchio_touchin_deinit(self);
mp_raise_ValueError(translate("No pulldown on pin; 1Mohm recommended"));
}
self->threshold = raw_reading * 1.05 + 100;
Expand Down

0 comments on commit d645e9c

Please sign in to comment.