Skip to content

Commit d6dc209

Browse files
committed
Fix ThreadDebug warnings when building for nRF52*
The Nordic headers already publicly define ASSERT and ARRAY_SIZE macros. #undef them and then define the ones custom to the ThreadDebug.o module instead.
1 parent 291a6af commit d6dc209

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/ThreadDebug/src/ThreadDebug.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ static const char* g_threadNamesToIgnore[] = {
7171
#define EXC_RETURN_THREADMODE_MAINSTACK 0x9
7272

7373
// Macro to make is easier to calculate array size.
74+
#undef ARRAY_SIZE
7475
#define ARRAY_SIZE(X) (sizeof(X)/sizeof(X[0]))
7576

7677
// Assert routine that will dump error text to USB GDB connection before entering infinite loop. If user is logging MRI
7778
// remote communications then they will see the error text in the log before debug stub becomes unresponseive.
79+
#undef ASSERT
7880
#define ASSERT(X) \
7981
if (!(X)) { \
8082
Serial.print("Assertion Failed: "); \

0 commit comments

Comments
 (0)