Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

__aeabi_assert()

__attribute__((weak,noreturn))
void __aeabi_assert (const char *expr, const char *file, int line) {
  char str[12], *p;

  fputs("*** assertion failed: ", stderr);
  fputs(expr, stderr);
  fputs(", file ", stderr);
  fputs(file, stderr);
  fputs(", line ", stderr);

  p = str + sizeof(str);
  *--p = '';
  *--p = '
';
  while (line > 0) {
    *--p = '0' + (line % 10);
    line /= 10;
  }
  fputs(p, stderr);

  abort();
}

__attribute__((weak))
void abort(void) {
  for (;;);
}
Source by www.keil.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+4 =