µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
reset-hardware.c
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ distribution.
3 * (https://github.com/micro-os-plus)
4 * Copyright (c) 2015-2023 Liviu Ionescu. All rights reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software
7 * for any purpose is hereby granted, under the terms of the MIT license.
8 *
9 * If a copy of the license was not distributed with this file, it can
10 * be obtained from https://opensource.org/licenses/mit/.
11 */
12
13#if defined(__clang__)
14#pragma clang diagnostic ignored "-Wempty-translation-unit"
15#endif
16
17// ----------------------------------------------------------------------------
18
19#if defined(__ARM_EABI__)
20
21// ----------------------------------------------------------------------------
22
23#if defined(OS_USE_OS_APP_CONFIG_H)
24#include <cmsis-plus/os-app-config.h>
25#endif
26
28#include <cmsis_device.h>
29
30// ----------------------------------------------------------------------------
31
32// cmsis_device.h
33// extern void __attribute__((noreturn))
34// NVIC_SystemReset (void);
35
36// ----------------------------------------------------------------------------
37
38// Forward declarations
39
40void
41__reset_hardware (void);
42
43// ----------------------------------------------------------------------------
44
45// This is the default hardware reset routine; it can be
46// redefined in the application for more complex applications.
47//
48// Called from _exit().
49
50void __attribute__((weak,noreturn))
52{
53#if defined(DEBUG) || defined(OS_DISABLE_RESET_HARDWARE)
54 trace_printf("__reset_hardware()");
55 while (1)
56 __WFI();
57#else
58 NVIC_SystemReset ();
59 __builtin_unreachable ();
60#endif
61}
62
63// ----------------------------------------------------------------------------
64
65#endif /* defined(__ARM_EABI__) */
void __reset_hardware(void)
int trace_printf(const char *format,...)