Skip to content
Snippets Groups Projects
Commit 4291c1f8 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

native: support add periph/pm support

parent 92f6fc68
Branches
No related tags found
No related merge requests found
FEATURES_PROVIDED += periph_pm
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "irq.h" #include "irq.h"
#include "cpu.h" #include "cpu.h"
#include "periph/pm.h"
#include "native_internal.h" #include "native_internal.h"
...@@ -446,7 +447,7 @@ static void native_shutdown(int sig, siginfo_t *info, void *context) ...@@ -446,7 +447,7 @@ static void native_shutdown(int sig, siginfo_t *info, void *context)
(void)info; (void)info;
(void)context; (void)context;
// TODO: poweroff pm_off();
} }
/** /**
......
/* /*
* Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> * Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
* *
* This file is subject to the terms and conditions of the GNU Lesser * This file is subject to the terms and conditions of the GNU Lesser General
* General Public License v2.1. See the file LICENSE in the top level * Public License v2.1. See the file LICENSE in the top level directory for
* directory for more details. * more details.
*/ */
/** /**
* @ingroup native_cpu * @ingroup native_cpu
* @{ * @{
*
* @file * @file
* @brief native reboot() implementation * @brief native Power Management implementation
*
* @author Kaspar Schleiser <kaspar@schleiser.de> * @author Kaspar Schleiser <kaspar@schleiser.de>
* @}
*/ */
#include <err.h> #include <err.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "periph/pm.h"
#include "native_internal.h" #include "native_internal.h"
#include "netdev2_tap.h" #include "netdev2_tap.h"
#include "tty_uart.h" #include "tty_uart.h"
void reboot(void) #define ENABLE_DEBUG (0)
#include "debug.h"
void pm_set_lowest(void)
{
_native_in_syscall++; // no switching here
real_pause();
_native_in_syscall--;
if (_native_sigpend > 0) {
_native_in_syscall++;
_native_syscall_leave();
}
}
void pm_off(void)
{
puts("\nnative: exiting");
real_exit(EXIT_SUCCESS);
}
void pm_reboot(void)
{ {
printf("\n\n\t\t!! REBOOT !!\n\n"); printf("\n\n\t\t!! REBOOT !!\n\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment