static void rtt_user_assert_hook(const char* ex, const char* func, rt_size_t line) { elog_output_lock_enabled(false); // elog_flash_lock_enabled(false); elog_a("rtt", "(%s) has assert failed at %s:%ld.\n", ex, func, line); // elog_flash_flush(); while(1); }
static void elog_user_assert_hook(const char* ex, const char* func, size_t line) { rt_enter_critical(); /* disable logger output lock */ elog_output_lock_enabled(false); /* disable flash plugin lock */ elog_flash_lock_enabled(false); /* output assert information */ elog_a("elog", "(%s) has assert failed at %s:%ld.\n", ex, func, line); /* write all buffered log to flash */ elog_flash_flush(); while(1); }