Within applied to UBL

This commit is contained in:
Scott Lahteine
2017-03-31 08:56:29 -05:00
parent 342ee458ae
commit b19a15fa7f
5 changed files with 37 additions and 37 deletions

View File

@@ -118,7 +118,7 @@
return;
}
if (m < 0 || m >= j || eeprom_start <= 0) {
if (!WITHIN(m, 0, j - 1) || eeprom_start <= 0) {
SERIAL_PROTOCOLLNPGM("?EEPROM storage not available to load mesh.\n");
return;
}
@@ -133,7 +133,7 @@
void unified_bed_leveling::store_mesh(const int16_t m) {
int16_t j = (UBL_LAST_EEPROM_INDEX - eeprom_start) / sizeof(z_values);
if (m < 0 || m >= j || eeprom_start <= 0) {
if (!WITHIN(m, 0, j - 1) || eeprom_start <= 0) {
SERIAL_PROTOCOLLNPGM("?EEPROM storage not available to load mesh.\n");
SERIAL_PROTOCOL(m);
SERIAL_PROTOCOLLNPGM(" mesh slots available.\n");