Skip to content

Commit 5d4e1a4

Browse files
committed
Stop SAMD21 from flushing (overflows flash with extra routine)
1 parent fb1f4d5 commit 5d4e1a4

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/Wippersnapper.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,28 @@
4747

4848
// Define actual debug output functions when necessary.
4949
#ifdef WS_DEBUG
50+
#if defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRWIFI1010)
5051
#define WS_DEBUG_PRINT(...) \
51-
{ WS_PRINTER.print(__VA_ARGS__); WS_PRINTER.flush(); } ///< Prints debug output.
52+
{ WS_PRINTER.print(__VA_ARGS__); yield(); } ///< Prints line from debug output.
5253
#define WS_DEBUG_PRINTLN(...) \
53-
{ WS_PRINTER.println(__VA_ARGS__); WS_PRINTER.flush(); } ///< Prints line from debug output.
54+
{ WS_PRINTER.println(__VA_ARGS__); yield(); } ///< Prints line from debug output.
5455
#define WS_DEBUG_PRINTHEX(...) \
55-
{ WS_PRINTER.print(__VA_ARGS__, HEX); WS_PRINTER.flush(); } ///< Prints debug output.
56+
{ WS_PRINTER.print(__VA_ARGS__, HEX); yield(); } ///< Prints debug output.
57+
#else
58+
#define WS_DEBUG_PRINT(...) \
59+
{ WS_PRINTER.print(__VA_ARGS__); WS_PRINTER.flush(); yield(); } ///< Prints line from debug output.
60+
#define WS_DEBUG_PRINTLN(...) \
61+
{ WS_PRINTER.println(__VA_ARGS__); WS_PRINTER.flush(); yield(); } ///< Prints line from debug output.
62+
#define WS_DEBUG_PRINTHEX(...) \
63+
{ WS_PRINTER.print(__VA_ARGS__, HEX); WS_PRINTER.flush(); yield(); } ///< Prints debug output.
64+
#endif
5665
#else
5766
#define WS_DEBUG_PRINT(...) \
5867
{} ///< Prints debug output
5968
#define WS_DEBUG_PRINTLN(...) \
6069
{} ///< Prints line from debug output.
70+
#define WS_DEBUG_PRINTHEX(...) \
71+
{} ///< Prints debug output.
6172
#endif
6273

6374
#define WS_DELAY_WITH_WDT(timeout) \

0 commit comments

Comments
 (0)