This commit is contained in:
2026-02-28 10:06:36 +01:00
parent 8a124fe17d
commit 99dcbca8ac
8 changed files with 82 additions and 38 deletions

View File

@@ -351,6 +351,7 @@ int cmd_reboot_device()
void cmd_play(const char *filename)
{
LOG_DBG("Play command received with filename: '%s'", filename);
audio_stop();
audio_play(filename);
}
@@ -366,6 +367,7 @@ int cmd_check(const char *param)
return -ENOENT;
}
uint32_t crc32 = 0;
uint32_t start_time = k_uptime_get_32();
uint8_t buffer[256];
ssize_t read;
while ((read = fs_read(&file, buffer, sizeof(buffer))) > 0)
@@ -378,7 +380,8 @@ int cmd_check(const char *param)
LOG_ERR("Check failed: error reading file '%s': %d", param, (int)read);
return (int)read;
}
LOG_DBG("Check successful: file '%s' has CRC32 0x%08x", param, crc32);
uint32_t duration = k_uptime_get_32() - start_time;
LOG_DBG("Check successful: file '%s' has CRC32 0x%08x, check took %u ms", param, crc32, duration);
char response[64];
snprintf(response, sizeof(response), "CRC32 %s 0x%08x\n", param, crc32);
usb_write_buffer((const uint8_t *)response, strlen(response));