updates the bsp_write and exit

This commit is contained in:
2025-03-21 16:05:01 +01:00
parent ada4881d33
commit 7d55172d51
2 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,7 @@
/* See LICENSE of license details. */
#include "weak_under_alias.h"
//#include <stdint.h>
#include <unistd.h>
#if defined(SEMIHOSTING)
#include "semihosting.h"
@ -17,19 +18,16 @@ extern volatile uint32_t fromhost;
void write_hex(int fd, uint32_t hex);
void __wrap_exit(int code) {
/*#if defined(SEMIHOSTING)
sh_exit();
return;
#endif*/
// volatile uint32_t* leds = (uint32_t*) (GPIO_BASE_ADDR + GPIO_OUT_OFFSET);
const char message[] = "\nProgam has exited with code:";
//*leds = (~(code));
write(STDERR_FILENO, message, sizeof(message) - 1);
write_hex(STDERR_FILENO, code);
write(STDERR_FILENO, "\n", 1);
tohost = code + 1;
tohost = (code << 1) + 1;
write(STDERR_FILENO, "\x04", 1);
for (;;)
;
}