Merge pull request #8606 from pea-pod/fix-bus-oboe

Fix off-by-one-error in BusIn/Out
pull/8589/head
Cruz Monrreal 2018-11-06 13:43:27 -06:00 committed by GitHub
commit 5549c52da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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];
}