Skip to content

Commit

Permalink
Fix out_of_range exception on bitset.test (#1977)
Browse files Browse the repository at this point in the history
  • Loading branch information
Niek authored and mcspr committed Nov 8, 2019
1 parent c6f75f9 commit 05a1029
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/espurna/gpio.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ std::bitset<GPIO_PINS> _gpio_locked;
std::bitset<GPIO_PINS> _gpio_available;

bool gpioValid(unsigned char gpio) {
if (gpio >= GPIO_PINS) return false;

return _gpio_available.test(gpio);
}

Expand Down

0 comments on commit 05a1029

Please sign in to comment.