throwPinAlreadyAllocated method

  1. @override
void throwPinAlreadyAllocated(
  1. int physicalPin
)
override

Implementation

@override
void throwPinAlreadyAllocated(int physicalPin) {
  if (physI2CPins.contains(physicalPin)) {
    throw GpioException(
        'If you want to use I2C pins for GPIO,'
        ' pass "i2c: false" into the RpiGpio constructor\n'
        'Already allocated',
        physicalPin);
  }
  if (physSpiPins.contains(physicalPin)) {
    throw GpioException(
        'If you want to use SPI pins for GPIO,'
        ' pass "spi: false" into the RpiGpio constructor\n'
        'Already allocated',
        physicalPin);
  }
  if (physEepromPins.contains(physicalPin)) {
    throw GpioException(
        'If you want to use EEPROM pins for GPIO,'
        ' pass "eeprom: false" into the RpiGpio constructor\n'
        'Already allocated',
        physicalPin);
  }
  super.throwPinAlreadyAllocated(physicalPin);
}