mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 22:57:36 +08:00
Remove reboot() API, replace with a prototype for up_systemreset() which is portable.
This commit is contained in:
@@ -73,41 +73,6 @@ const struct __multiport_info multiport_info = {
|
||||
|
||||
static void kill_task(FAR _TCB *tcb, FAR void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* user_start
|
||||
****************************************************************************/
|
||||
|
||||
int reboot(void)
|
||||
{
|
||||
sched_lock();
|
||||
// print text
|
||||
printf("\r\nRebooting system - ending tasks and performing hard reset\r\n\r\n");
|
||||
fflush(stdout);
|
||||
//usleep(5000);
|
||||
|
||||
/* Sending kill signal to other tasks */
|
||||
//killall();
|
||||
|
||||
/* Waiting maximum time for all to exit */
|
||||
//usleep(5000);
|
||||
//sched_lock();
|
||||
|
||||
/* Resetting CPU */
|
||||
// FIXME Need check for ARM architecture here
|
||||
#ifndef NVIC_AIRCR
|
||||
#define NVIC_AIRCR (*((uint32_t*)0xE000ED0C))
|
||||
#endif
|
||||
|
||||
/* Set the SYSRESETREQ bit to force a reset */
|
||||
NVIC_AIRCR = 0x05fa0004;
|
||||
|
||||
/* Spinning until the board is really reset */
|
||||
while (true);
|
||||
|
||||
/* Should never reach here */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void killall()
|
||||
{
|
||||
// printf("Sending SIGUSR1 to all processes now\n");
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
__BEGIN_DECLS
|
||||
|
||||
/** Reboots the board */
|
||||
__EXPORT int reboot(void);
|
||||
extern void up_systemreset(void) noreturn_function;
|
||||
|
||||
/** Sends SIGUSR1 to all processes */
|
||||
__EXPORT void killall(void);
|
||||
|
||||
Reference in New Issue
Block a user