File tree Expand file tree Collapse file tree 3 files changed +37
-8
lines changed Expand file tree Collapse file tree 3 files changed +37
-8
lines changed Original file line number Diff line number Diff line change 2020
2121#include "PeripheralPins.h"
2222
23- /**
24- * Libc porting layers
25- */
26- #if defined ( __GNUC__ ) /* GCC CS3 */
27- #include <syscalls.h> /** RedHat Newlib minimal stub */
28- #define WEAK __attribute__ ((weak))
29- #endif
30-
3123// Arduino digital pin alias
3224// GPIO port (A to K) * 16 pins: 176
3325enum {
Original file line number Diff line number Diff line change 1+ #include "stm32_def.h"
2+
3+ #ifdef __cplusplus
4+ extern "C" {
5+ #endif
6+
7+ /**
8+ * @brief This function is executed in case of error occurrence.
9+ * @param None
10+ * @retval None
11+ */
12+ WEAK void _Error_Handler (const char * msg , int val )
13+ {
14+ /* User can add his own implementation to report the HAL error return state */
15+ printf ("Error: %s (%i)\n" , msg , val );
16+ while (1 )
17+ {
18+ }
19+ }
20+
21+ #ifdef __cplusplus
22+ }
23+ #endif
Original file line number Diff line number Diff line change 7474#define CAN1 CAN
7575#endif
7676
77+ /**
78+ * Libc porting layers
79+ */
80+ #if defined ( __GNUC__ ) /* GCC CS3 */
81+ #include <syscalls.h> /** RedHat Newlib minimal stub */
82+ #define WEAK __attribute__ ((weak))
83+ #endif
84+
7785#ifdef __cplusplus
7886extern "C" {
7987#endif // __cplusplus
88+
8089// weaked functions declaration
8190void SystemClock_Config (void );
91+
92+ void _Error_Handler (const char * , int );
93+
94+ #define Error_Handler () _Error_Handler(__FILE__, __LINE__)
95+
8296#ifdef __cplusplus
8397} // extern "C"
8498#endif // __cplusplus
You can’t perform that action at this time.
0 commit comments