mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 10:28:29 -04:00
Desktop: added -w option to wipe eeprom and dataflash
This commit is contained in:
parent
ae1e1c940f
commit
3b48389efe
@ -17,6 +17,7 @@ static void usage(void)
|
|||||||
{
|
{
|
||||||
printf("Options:\n");
|
printf("Options:\n");
|
||||||
printf("\t-s enable CLI slider switch\n");
|
printf("\t-s enable CLI slider switch\n");
|
||||||
|
printf("\t-w wipe eeprom and dataflash\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char * const argv[])
|
int main(int argc, char * const argv[])
|
||||||
@ -27,14 +28,18 @@ int main(int argc, char * const argv[])
|
|||||||
desktop_state.slider = false;
|
desktop_state.slider = false;
|
||||||
gettimeofday(&desktop_state.sketch_start_time, NULL);
|
gettimeofday(&desktop_state.sketch_start_time, NULL);
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "sh")) != -1) {
|
while ((opt = getopt(argc, argv, "swh")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 's':
|
case 's':
|
||||||
desktop_state.slider = true;
|
desktop_state.slider = true;
|
||||||
break;
|
break;
|
||||||
|
case 'w':
|
||||||
|
unlink("eeprom.bin");
|
||||||
|
unlink("dataflash.bin");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
break;
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user