mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-10-01 01:45:38 -04:00
09c1f3f549
The only real changes are some unitialized variables and that we now make explicit that we don't care about the return value from memset().
31 lines
561 B
C
31 lines
561 B
C
/*
|
|
* Copyright (C) 2022, 2023 - Tillitis AB
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
*/
|
|
|
|
#include "assert.h"
|
|
#include "led.h"
|
|
#include "lib.h"
|
|
|
|
void assert_fail(const char *assertion, const char *file, unsigned int line,
|
|
const char *function)
|
|
{
|
|
htif_puts("assert: ");
|
|
htif_puts(assertion);
|
|
htif_puts(" ");
|
|
htif_puts(file);
|
|
htif_puts(":");
|
|
htif_putinthex(line);
|
|
htif_puts(" ");
|
|
htif_puts(function);
|
|
htif_lf();
|
|
|
|
#ifndef S_SPLINT_S
|
|
// Force illegal instruction to halt CPU
|
|
asm volatile("unimp");
|
|
#endif
|
|
|
|
// Not reached
|
|
__builtin_unreachable();
|
|
}
|