Updated Debug mode (markdown)

master
Jan Gromeš 2024-08-05 19:26:00 +02:00
rodzic dce54707d6
commit 8f66eec1eb
1 zmienionych plików z 20 dodań i 1 usunięć

@ -27,4 +27,23 @@ Enabling this macro will only print out basic debug info - for example, timeouts
Enabling this macro will print information important for debugging protocols. This is very useful when debugging LoRaWAN.
### RADIOLIB_DEBUG_SPI ("RLB_SPI")
Enabling this macro will print out full transcript of all SPI communication. It should be noted that this outputs A LOT of information in the debug log. This can make debugging higher levels (e.g. protocols) cumbersome, so it should only be used when investigating issues with the radio module itself.
Enabling this macro will print out full transcript of all SPI communication. It should be noted that this outputs A LOT of information in the debug log. This can make debugging higher levels (e.g. protocols) cumbersome, so it should only be used when investigating issues with the radio module itself.
## Assertions
During runtime, RadioLib performs checks to make sure any error is caught as quickly as possible. This is done using a simple assertion macro that will return when the result of a previous operation was a not-OK status code. Therefore, any given public API method returns immediately after encountering an error. However, that error may be propagated through multiple layers of the library before reaching the user. To make tracing such failures easier, RadioLib provides the macro `RADIOLIB_VERBOSE_ASSERT`. If set to 1, this macro will print a trace of the failure (including source file and line information) using the `RADIOLIB_DEBUG_BASIC` debug level. Enabling this macro will also enable `RADIOLIB_DEBUG_BASIC `. Keep in mind that as with any debugging, this will increase the size of the binary! An example output is shown below, with the last two lines showing the file and line information of the failed assertions.
```
19:22:18.593 -> RLB_DBG: RadioLib Info
19:22:18.593 -> Version: "6.6.0.0"
19:22:18.593 -> Platform: "Adafruit nRF52"
19:22:18.593 -> Compiled: "Aug 4 2024" "16:26:06"
19:22:18.870 -> RLB_DBG: LR11x0 not found! (1 of 10 tries) RADIOLIB_LR11X0_CMD_GET_VERSION = 0x01
19:22:18.870 -> RLB_DBG: Expected: 0x03
(...)
19:22:21.785 -> RLB_DBG: LR11x0 not found! (10 of 10 tries) RADIOLIB_LR11X0_CMD_GET_VERSION = 0x01
19:22:21.785 -> RLB_DBG: Expected: 0x03
19:22:21.785 -> RLB_DBG: No LR11x0 found!
19:22:21.785 -> RLB_DBG: RADIOLIB_ASSERT -2 at C:\Users\user\Documents\Arduino\libraries\RadioLib\src\modules\LR11x0\LR11x0.cpp:19
19:22:21.785 -> RLB_DBG: RADIOLIB_ASSERT -2 at C:\Users\user\Documents\Arduino\libraries\RadioLib\src\modules\LR11x0\LR1120.cpp:11
```