Skip to content

Commit

Permalink
Merge pull request #335 from sifive/add-segger-assert
Browse files Browse the repository at this point in the history
Add __SEGGER_RTL_X_assert support for segger libc
  • Loading branch information
nategraff-sifive authored Sep 4, 2020
2 parents 4afda0c + 895a29e commit 572c157
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions segger/SEGGER_target_metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <metal/timer.h>
#include <metal/tty.h>

#define UNUSED(x) (void)(x)

/* metal heap start address is provided in target linker script */
extern char metal_segment_heap_target_start;
extern char __heap_size;
Expand Down Expand Up @@ -92,6 +94,15 @@ int __SEGGER_RTL_X_get_time_of_day(struct timeval *tp) {

int __SEGGER_RTL_X_set_time_of_day(const struct timeval *tp) { return 0; }

void __SEGGER_RTL_X_assert(const char *stmt, const char *file, int line) {
UNUSED(file);
UNUSED(line);
puts("Failed: ");
puts(stmt);
puts("\n");
exit(1);
}

int __SEGGER_RTL_stdin_getc(void) {
int r;

Expand Down

0 comments on commit 572c157

Please sign in to comment.