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