mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
native: allow for native to be resetable via SIGUSR1
This commit is contained in:
parent
5db4310b45
commit
fa317910d0
@ -44,6 +44,7 @@
|
||||
#include "tty_uart.h"
|
||||
|
||||
#include "periph/init.h"
|
||||
#include "periph/pm.h"
|
||||
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
@ -390,6 +391,11 @@ extern init_func_t __init_array_start;
|
||||
extern init_func_t __init_array_end;
|
||||
#endif
|
||||
|
||||
static void _reset_handler(void)
|
||||
{
|
||||
pm_reboot();
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void startup(int argc, char **argv, char **envp)
|
||||
{
|
||||
_native_init_syscalls();
|
||||
@ -577,6 +583,8 @@ __attribute__((constructor)) static void startup(int argc, char **argv, char **e
|
||||
periph_init();
|
||||
board_init();
|
||||
|
||||
register_interrupt(SIGUSR1, _reset_handler);
|
||||
|
||||
puts("RIOT native hardware initialization complete.\n");
|
||||
irq_enable();
|
||||
kernel_init();
|
||||
|
Loading…
Reference in New Issue
Block a user