reboot.c: switch to px4_shutdown_request()

This commit is contained in:
Beat Küng 2017-04-18 14:09:14 +02:00 committed by Lorenz Meier
parent 1d1eedb086
commit 7cb71af949
1 changed files with 12 additions and 2 deletions

View File

@ -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;
}