From 3b48389efeb69accc2b027df467430ff95779d91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Nov 2011 22:26:52 +1100 Subject: [PATCH] Desktop: added -w option to wipe eeprom and dataflash --- libraries/Desktop/support/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/Desktop/support/main.cpp b/libraries/Desktop/support/main.cpp index 2e83642cf1..cb4eb4cb50 100644 --- a/libraries/Desktop/support/main.cpp +++ b/libraries/Desktop/support/main.cpp @@ -17,6 +17,7 @@ static void usage(void) { printf("Options:\n"); printf("\t-s enable CLI slider switch\n"); + printf("\t-w wipe eeprom and dataflash\n"); } int main(int argc, char * const argv[]) @@ -27,14 +28,18 @@ int main(int argc, char * const argv[]) desktop_state.slider = false; gettimeofday(&desktop_state.sketch_start_time, NULL); - while ((opt = getopt(argc, argv, "sh")) != -1) { + while ((opt = getopt(argc, argv, "swh")) != -1) { switch (opt) { case 's': desktop_state.slider = true; break; + case 'w': + unlink("eeprom.bin"); + unlink("dataflash.bin"); + break; default: usage(); - break; + exit(1); } }