mirror of https://github.com/MLXXXp/Arduboy2.git
optimize readUnitName (-6 bytes)
This commit is contained in:
parent
5877208a57
commit
1280160f89
|
@ -995,12 +995,12 @@ uint8_t Arduboy2Base::readUnitName(char* name)
|
||||||
|
|
||||||
for (dest = 0; dest < ARDUBOY_UNIT_NAME_LEN; dest++)
|
for (dest = 0; dest < ARDUBOY_UNIT_NAME_LEN; dest++)
|
||||||
{
|
{
|
||||||
if ((val = EEPROM.read(src)) == 0x00 || (byte)val == 0xFF)
|
val = EEPROM.read(src);
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
name[dest] = val;
|
name[dest] = val;
|
||||||
src++;
|
src++;
|
||||||
|
if (val == 0x00 || (byte)val == 0xFF) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
name[dest] = 0x00;
|
name[dest] = 0x00;
|
||||||
|
|
Loading…
Reference in New Issue