Browse Source

Fix out_of_range exception on bitset.test (#1977)

master
Niek van der Maas 5 years ago
committed by Max Prokhorov
parent
commit
05a1029bbd
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      code/espurna/gpio.ino

+ 2
- 0
code/espurna/gpio.ino View File

@ -14,6 +14,8 @@ std::bitset<GPIO_PINS> _gpio_locked;
std::bitset<GPIO_PINS> _gpio_available; std::bitset<GPIO_PINS> _gpio_available;
bool gpioValid(unsigned char gpio) { bool gpioValid(unsigned char gpio) {
if (gpio >= GPIO_PINS) return false;
return _gpio_available.test(gpio); return _gpio_available.test(gpio);
} }


Loading…
Cancel
Save