Add and apply WITHIN macro

This commit is contained in:
Scott Lahteine
2017-03-31 09:00:49 -05:00
parent 93aad54dc1
commit 25a6bfa7ed
11 changed files with 74 additions and 71 deletions

View File

@ -42,7 +42,7 @@ void TWIBus::reset() {
}
void TWIBus::address(const uint8_t adr) {
if (adr < 8 || adr > 127) {
if (!WITHIN(adr, 8, 127)) {
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Bad I2C address (8-127)");
}