Skip to content

Commit 92a710a

Browse files
committed
Use a minimal '__assert_func' to prevent debug build issues
Fixes #6
1 parent 8ae7c96 commit 92a710a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

flashloader.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,25 @@ void hard_assertion_failure(void)
9393
}
9494
#endif
9595

96+
//****************************************************************************
97+
// Provide our own assert function to prevent the default version pulling
98+
// in 'printf' functions in debug builds
99+
void __assert_func(const char *filename,
100+
int line,
101+
const char *assert_func,
102+
const char *expr)
103+
{
104+
(void)filename;
105+
(void)line;
106+
(void)assert_func;
107+
(void)expr;
108+
109+
__breakpoint();
110+
111+
while(true)
112+
tight_loop_contents();
113+
}
114+
96115
//****************************************************************************
97116
// Calculate the CRC32 (no reflection, no final XOR) of a block of data.
98117
// This makes use of the DMA sniffer to calculate the CRC for us. Speed is

0 commit comments

Comments
 (0)