X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fao_storage.c;h=709259ee977cee2305fcabc04c18efddc1c3a56d;hp=25a7c8b9016a651558c98233abc83a1d5a22edee;hb=7ad419d81c90ef6a16656970466313767fef830f;hpb=569a1dac55b70c30f01afa7bcb74442ecdd85d85 diff --git a/src/ao_storage.c b/src/ao_storage.c index 25a7c8b9..709259ee 100644 --- a/src/ao_storage.c +++ b/src/ao_storage.c @@ -92,7 +92,7 @@ ao_storage_dump(void) __reentrant storage_data, 8)) { ao_cmd_put16((uint16_t) i); - for (j = 0; j < 7; j++) { + for (j = 0; j < 8; j++) { putchar(' '); ao_cmd_put8(storage_data[j]); } @@ -103,6 +103,10 @@ ao_storage_dump(void) __reentrant } } +#if 0 + +/* not enough space for this today + */ static void ao_storage_store(void) __reentrant { @@ -130,6 +134,7 @@ ao_storage_store(void) __reentrant addr++; } } +#endif void ao_storage_zap(void) __reentrant @@ -140,6 +145,18 @@ ao_storage_zap(void) __reentrant ao_storage_erase((uint32_t) ao_cmd_lex_i << 8); } +void +ao_storage_zapall(void) __reentrant +{ + uint32_t pos; + + ao_cmd_white(); + if (!ao_match_word("DoIt")) + return; + for (pos = 0; pos < ao_storage_config; pos += ao_storage_block) + ao_storage_erase(pos); +} + void ao_storage_info(void) __reentrant { @@ -151,8 +168,11 @@ ao_storage_info(void) __reentrant __code struct ao_cmds ao_storage_cmds[] = { { 'f', ao_storage_info, "f Show storage info" }, { 'e', ao_storage_dump, "e Dump a block of flash data" }, - { 'w', ao_storage_store,"w ... Write data to flash" }, - { 'z', ao_storage_zap, "z Erase flash containing " }, +#if 0 + { 'w', ao_storage_store, "w ... Write data to flash" }, +#endif + { 'z', ao_storage_zap, "z Erase flash containing " }, + { 'Z', ao_storage_zapall,"Z Erase all logs. is doit with D&I" }, { 0, ao_storage_zap, NULL }, };