GEX core repository.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
gex-core/stm32_assert.c

38 lines
1.1 KiB

#include "platform.h"
#include "platform/status_led.h"
/**
* Abort at file, line with a custom tag (eg. ASSERT FAILED)
* @param msg - tag message
* @param filename - file
* @param line - line
*/
void __attribute__((noreturn)) abort_msg(const char *msg, const char *filename, uint32_t line)
{
dbg("\r\n\033[31m%s:\033[m %s:%"PRIu32, msg, filename, line);
vPortEnterCritical();
StatusLed_On(STATUS_FAULT);
while(1);
}
/**
* Warn at file, line with a custom tag (eg. ASSERT FAILED)
* @param msg - tag message
* @param filename - file
* @param line - line
*/
void warn_msg(const char *msg, const char *filename, uint32_t line)
{
dbg("\r\n\033[33m%s:\033[m %s:%"PRIu32, msg, filename, line);
}
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
*/
void __attribute__((noreturn)) assert_failed_(const char *file, uint32_t line)
{
abort_msg("ASSERT FAILED", file, line);
}