|
46 | 46 |
|
47 | 47 | // Define actual debug output functions when necessary.
|
48 | 48 | #ifdef WS_DEBUG
|
| 49 | +#if defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRWIFI1010) |
49 | 50 | #define WS_DEBUG_PRINT(...) \
|
50 |
| - { WS_PRINTER.print(__VA_ARGS__); } ///< Prints debug output. |
| 51 | + { \ |
| 52 | + WS_PRINTER.print(__VA_ARGS__); \ |
| 53 | + yield(); \ |
| 54 | + } ///< Prints line from debug output. |
| 55 | +#define WS_DEBUG_PRINTLN(...) \ |
| 56 | + { \ |
| 57 | + WS_PRINTER.println(__VA_ARGS__); \ |
| 58 | + yield(); \ |
| 59 | + } ///< Prints line from debug output. |
| 60 | +#define WS_DEBUG_PRINTHEX(...) \ |
| 61 | + { \ |
| 62 | + WS_PRINTER.print(__VA_ARGS__, HEX); \ |
| 63 | + yield(); \ |
| 64 | + } ///< Prints debug output. |
| 65 | +#else |
| 66 | +#define WS_DEBUG_PRINT(...) \ |
| 67 | + { \ |
| 68 | + WS_PRINTER.print(__VA_ARGS__); \ |
| 69 | + WS_PRINTER.flush(); \ |
| 70 | + yield(); \ |
| 71 | + } ///< Prints line from debug output. |
51 | 72 | #define WS_DEBUG_PRINTLN(...) \
|
52 |
| - { WS_PRINTER.println(__VA_ARGS__); } ///< Prints line from debug output. |
| 73 | + { \ |
| 74 | + WS_PRINTER.println(__VA_ARGS__); \ |
| 75 | + WS_PRINTER.flush(); \ |
| 76 | + yield(); \ |
| 77 | + } ///< Prints line from debug output. |
53 | 78 | #define WS_DEBUG_PRINTHEX(...) \
|
54 |
| - { WS_PRINTER.print(__VA_ARGS__, HEX); } ///< Prints debug output. |
| 79 | + { \ |
| 80 | + WS_PRINTER.print(__VA_ARGS__, HEX); \ |
| 81 | + WS_PRINTER.flush(); \ |
| 82 | + yield(); \ |
| 83 | + } ///< Prints debug output. |
| 84 | +#endif |
55 | 85 | #else
|
56 | 86 | #define WS_DEBUG_PRINT(...) \
|
57 | 87 | {} ///< Prints debug output
|
58 | 88 | #define WS_DEBUG_PRINTLN(...) \
|
59 | 89 | {} ///< Prints line from debug output.
|
| 90 | +#define WS_DEBUG_PRINTHEX(...) \ |
| 91 | + {} ///< Prints debug output. |
60 | 92 | #endif
|
61 | 93 |
|
62 | 94 | #define WS_DELAY_WITH_WDT(timeout) \
|
|
0 commit comments