You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -329,18 +329,21 @@ The remaining variables are rarely used, but we list them here for completeness.
329
329
330
330
`#define LMIC_PRINTF_TO SerialLikeObject`
331
331
332
-
This variable should be set to the name of a `Serial`-like object, used for printing messages. If not defined, `Serial`
333
-
is assumed.
332
+
This variable should be set to the name of a `Serial`-like object (any subclass of Arduino's `Print` class), used for printing messages. If this variable is set, any calls to the standard `printf` function (or more generally all writes to the global `stdout` file descriptor) will redirected to the specified stream.
333
+
334
+
When this is not defined, `printf` and `stdout` are untouched and their behavior might vary among boards (and could print to somewhere, but also throw away output or crash). So *if* you want to use `printf` or `LMIC_DEBUG_LEVEL`, make sure to also define this.
334
335
335
336
#### Getting debug from the RF library
336
337
337
338
`#define LMIC_DEBUG_LEVEL number /* 0, 1, or 2 */`
338
339
339
340
This variable determines the amount of debug output to be produced by the library. The default is `0`.
340
341
341
-
If `LMIC_DEBUG_LEVEL` is zero, no output is produced. If `1`, limited output is produced. If `2`, more extensive
342
-
output is produced. If non-zero, `printf()` is used, and the Arduino environment must be configured to support it,
343
-
otherwise the sketch will crash at runtime.
342
+
If `LMIC_DEBUG_LEVEL` is zero, no output is produced. If `1`, limited output is produced. If `2`, more extensive output is produced.
343
+
344
+
Note that debug output will influence the timing of various parts of the library and could introduce timing problems (especially in the RX window timing), so use it carefully.
345
+
346
+
Debug output is generated using the standard `printf` function, so unless your environment already redirects `printf` / `stdout` somewhere, you should also configure `LIMC_PRINTF_TO`.
0 commit comments