Fix off-by-one-error in BusIn/Out

pull/8775/head
William Kelly III 2018-10-31 12:28:53 -05:00 committed by adbridge
parent 8f948f640c
commit 10fed1b1e8
3 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ BusIn::operator int()
DigitalIn &BusIn::operator[](int index)
{
// No lock needed since _pin is not modified outside the constructor
MBED_ASSERT(index >= 0 && index <= 16);
MBED_ASSERT(index >= 0 && index < 16);
MBED_ASSERT(_pin[index]);
return *_pin[index];
}

View File

@ -128,7 +128,7 @@ BusInOut &BusInOut::operator= (BusInOut &rhs)
DigitalInOut &BusInOut::operator[](int index)
{
// No lock needed since _pin is not modified outside the constructor
MBED_ASSERT(index >= 0 && index <= 16);
MBED_ASSERT(index >= 0 && index < 16);
MBED_ASSERT(_pin[index]);
return *_pin[index];
}

View File

@ -95,7 +95,7 @@ BusOut &BusOut::operator= (BusOut &rhs)
DigitalOut &BusOut::operator[](int index)
{
// No lock needed since _pin is not modified outside the constructor
MBED_ASSERT(index >= 0 && index <= 16);
MBED_ASSERT(index >= 0 && index < 16);
MBED_ASSERT(_pin[index]);
return *_pin[index];
}