Skip to content

Commit

Permalink
Merge pull request #507 from LedgerHQ/xch/assert-include
Browse files Browse the repository at this point in the history
ledger_assert: Fix circular dependency
  • Loading branch information
xchapron-ledger authored Jan 18, 2024
2 parents 3957522 + a501ab9 commit 814940c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/ledger_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdbool.h>

#ifdef HAVE_PRINTF
#include "os.h"
void assert_print_failed(void);
#endif

#ifdef LEDGER_ASSERT_CONFIG_FILE_INFO
Expand Down Expand Up @@ -97,7 +97,7 @@ void assert_print_file_info(const char *file, int line);
ASSERT_DISPLAY_LR_AND_PC(_lr_address, _pc_address); \
} while (0)
#elif defined(HAVE_PRINTF)
#define LEDGER_ASSERT_LR_AND_PC() PRINTF("LEDGER_ASSERT FAILED\n")
#define LEDGER_ASSERT_LR_AND_PC() assert_print_failed()
#else
#define LEDGER_ASSERT_LR_AND_PC() \
do { \
Expand Down
7 changes: 7 additions & 0 deletions src/ledger_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
static char assert_buffer[ASSERT_BUFFER_LEN];
#endif

#if defined(HAVE_PRINTF)
void assert_print_failed(void)
{
PRINTF("LEDGER_ASSERT FAILED\n");
}
#endif

#if defined(HAVE_LEDGER_ASSERT_DISPLAY) && defined(LEDGER_ASSERT_CONFIG_LR_AND_PC_INFO)
void assert_display_lr_and_pc(int lr, int pc)
{
Expand Down

0 comments on commit 814940c

Please sign in to comment.