Skip to content

Commit 32114b3

Browse files
Enable interrupts on assertion failure
This prevents printing with interrupts disabled, which is problematic on some Arduino cores, see e.g. arduino/ArduinoCore-samd#472
1 parent 931d301 commit 32114b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lmic/oslmic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef const char* str_t;
4444
if(!(cond)) { fprintf(stderr, "ASSERTION FAILED: %s at %s:%d\n", \
4545
#cond, __FILE__, __LINE__); hal_failed(); } } while (0)
4646
#elif defined(CFG_DEBUG)
47-
#define ASSERT(cond) do { if(!(cond)) { debug_printf("%s:%d: assertion failed\r\n", __FILE__, __LINE__); hal_failed(); } } while (0)
47+
#define ASSERT(cond) do { if(!(cond)) { hal_enableIRQs(); debug_printf("%s:%d: assertion failed\r\n", __FILE__, __LINE__); hal_failed(); } } while (0)
4848
#else
4949
#define ASSERT(cond) do { if(!(cond)) hal_failed(); } while (0)
5050
#endif

0 commit comments

Comments
 (0)