From 2a166e42a56750bb6a6ec71f0d76a0fdc24ca1a4 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Tue, 11 Jul 2017 13:35:56 +0000 Subject: [PATCH] Refs #363. Added newlib _exit.c to Nucleo-F303K8 GCC demo user program. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@285 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- .../Prog/lib/newlib/_exit.c | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Target/Demo/ARMCM4_STM32F3_Nucleo_F303K8_GCC/Prog/lib/newlib/_exit.c 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); +} + +// ----------------------------------------------------------------------------