Remove reboot() API, replace with a prototype for up_systemreset() which is portable.

This commit is contained in:
px4dev
2012-10-27 22:42:43 -07:00
parent 22b0add293
commit 98791bc674
6 changed files with 12 additions and 42 deletions
-35
View File
@@ -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");
+1 -1
View File
@@ -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);