Splash modified playername.txt on device startup

if playername.txt is modified its now splashed on device start-up

should be less confusing than having it in the WPS theme I hope..

Change-Id: Ifcec491f75a0c977a98d26292509f4ca62d79dac
This commit is contained in:
William Wilgus 2025-07-20 12:16:15 -04:00
parent 6df48c5f7f
commit 9d92d161d8

View file

@ -201,6 +201,7 @@ int main(void)
#if !defined(BOOTLOADER)
allocate_playback_log();
static char playername[64];
if (!file_exists(ROCKBOX_DIR"/playername.txt"))
{
int fd = open(ROCKBOX_DIR"/playername.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666);
@ -210,6 +211,17 @@ int main(void)
close(fd);
}
}
else
{
int fd = open(ROCKBOX_DIR"/playername.txt", O_RDONLY);
if(fd >= 0)
{
read_line(fd, playername, sizeof(playername));
close(fd);
if (strcmp(playername, MODEL_NAME) != 0)
splashf(HZ * 2, "%s", playername);
}
}
#endif
#ifdef AUTOROCK