1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 03:50:02 +03:00

Add flash_scan to cli

This commit is contained in:
Dominic Clifton 2018-12-02 03:14:11 +01:00 committed by jflyper
parent c0ee056d68
commit 0e4cc5c3cf
3 changed files with 60 additions and 0 deletions

View file

@ -2260,6 +2260,18 @@ static void cliFlashErase(char *cmdline)
#ifdef USE_FLASH_TOOLS
static void cliFlashVerify(char *cmdline)
{
UNUSED(cmdline);
cliPrintLine("Verifying");
if (flashfsVerifyEntireFlash()) {
cliPrintLine("Success");
} else {
cliPrintLine("Failed");
}
}
static void cliFlashWrite(char *cmdline)
{
const uint32_t address = atoi(cmdline);
@ -5779,6 +5791,7 @@ const clicmd_t cmdTable[] = {
CLI_COMMAND_DEF("flash_info", "show flash chip info", NULL, cliFlashInfo),
#ifdef USE_FLASH_TOOLS
CLI_COMMAND_DEF("flash_read", NULL, "<length> <address>", cliFlashRead),
CLI_COMMAND_DEF("flash_scan", "scan flash device for errors", NULL, cliFlashVerify),
CLI_COMMAND_DEF("flash_write", NULL, "<address> <message>", cliFlashWrite),
#endif
#endif