diff --git a/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/lib/newlib/_exit.c b/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/lib/newlib/_exit.c new file mode 100644 index 00000000..4ae9532c --- /dev/null +++ b/Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/lib/newlib/_exit.c @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------- + +#include + +// ---------------------------------------------------------------------------- + +// Forward declaration + +void +_exit(int code); + +// ---------------------------------------------------------------------------- + +// We just enter an infinite loop, to be used as landmark when halting +// the debugger. +// +// It can be redefined in the application, if more functionality +// is required. + +void +__attribute__((weak)) +_exit(int code __attribute__((unused))) +{ + // TODO: write on trace + while (1) + ; +} + +// ---------------------------------------------------------------------------- + +void +__attribute__((weak,noreturn)) +abort(void) +{ + _exit(1); +} + +// ----------------------------------------------------------------------------