Skip to content
Snippets Groups Projects
Commit 7cb71af9 authored by Beat Küng's avatar Beat Küng Committed by Lorenz Meier
Browse files

reboot.c: switch to px4_shutdown_request()

parent 1d1eedb0
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,8 @@
#include <px4_config.h>
#include <px4_getopt.h>
#include <px4_tasks.h>
#include <px4_log.h>
#include <px4_shutdown.h>
#include <systemlib/systemlib.h>
__EXPORT int reboot_main(int argc, char *argv[]);
......@@ -62,9 +62,19 @@ int reboot_main(int argc, char *argv[])
default:
PX4_ERR("usage: reboot [-b]\n"
" -b reboot into the bootloader");
break;
}
}
px4_systemreset(to_bootloader);
int ret = px4_shutdown_request(true, to_bootloader);
if (ret < 0) {
PX4_ERR("reboot failed (%i)", ret);
return -1;
}
while (1) { usleep(1); } // this command should not return on success
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment