mirror of https://github.com/MLXXXp/Arduboy2.git
optimize writeUnitName (-130 bytes)
This commit is contained in:
parent
6050dda391
commit
5877208a57
|
@ -1014,17 +1014,14 @@ void Arduboy2Base::writeUnitName(char* name)
|
||||||
|
|
||||||
for (uint8_t src = 0; src < ARDUBOY_UNIT_NAME_LEN; src++)
|
for (uint8_t src = 0; src < ARDUBOY_UNIT_NAME_LEN; src++)
|
||||||
{
|
{
|
||||||
if (name[src] != 0x00 && !done)
|
if (name[src] == 0x00) {
|
||||||
{
|
|
||||||
EEPROM.update(dest, name[src]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
done = true;
|
done = true;
|
||||||
EEPROM.update(dest, 0x00);
|
|
||||||
}
|
}
|
||||||
|
// write character or 0 pad if finished
|
||||||
|
EEPROM.update(dest, done ? 0x00 : name[src]);
|
||||||
dest++;
|
dest++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Arduboy2Base::readShowUnitNameFlag()
|
bool Arduboy2Base::readShowUnitNameFlag()
|
||||||
|
|
Loading…
Reference in New Issue