Skip to content

Commit

Permalink
Enable interrupts on assertion failure
Browse files Browse the repository at this point in the history
This prevents printing with interrupts disabled, which is problematic on some
Arduino cores, see e.g.  arduino/ArduinoCore-samd#472
  • Loading branch information
matthijskooijman committed Feb 12, 2020
1 parent f5f138e commit 8810fc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lmic/oslmic.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef const char* str_t;
#if defined(__AVR__)
#define ASSERT(cond) do { if(!(cond)) { debug_printf("%P:%d: assertion failed\r\n", PSTR(__FILE__), __LINE__); hal_failed(); } } while (0)
#else
#define ASSERT(cond) do { if(!(cond)) { debug_printf("%s:%d: assertion failed\r\n", __FILE__, __LINE__); hal_failed(); } } while (0)
#define ASSERT(cond) do { if(!(cond)) { hal_enableIRQs(); debug_printf("%s:%d: assertion failed\r\n", __FILE__, __LINE__); hal_failed(); } } while (0)
#endif
#else
#define ASSERT(cond) do { if(!(cond)) hal_failed(); } while (0)
Expand Down

0 comments on commit 8810fc4

Please sign in to comment.