From 7ffe530fcbbff21379e45cc686f83daae1c5d565 Mon Sep 17 00:00:00 2001 From: jgromes Date: Wed, 5 Feb 2025 21:53:55 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2045de7?= =?UTF-8?q?978dc5db753251d437393e4905699333361=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _build_opt_8h_source.html | 586 +++++++++++++++++++------------------- 1 file changed, 295 insertions(+), 291 deletions(-) diff --git a/_build_opt_8h_source.html b/_build_opt_8h_source.html index d5e5c64a..3b87e5a3 100644 --- a/_build_opt_8h_source.html +++ b/_build_opt_8h_source.html @@ -364,325 +364,329 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html',''); initRe
264 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
265 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
266
-
267 // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
268 #define RADIOLIB_TONE_UNSUPPORTED
-
269 #define RADIOLIB_MBED_TONE_OVERRIDE
-
270
-
271#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
-
272 // Arduino Portenta H7
-
273 #define RADIOLIB_PLATFORM "Portenta H7"
-
274 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
275 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
276 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
277
-
278 // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
279 #define RADIOLIB_TONE_UNSUPPORTED
-
280 #define RADIOLIB_MBED_TONE_OVERRIDE
-
281
-
282#elif defined(__STM32F4__) || defined(__STM32F1__)
-
283 // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
-
284 #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
-
285 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (WiringPinMode)
-
286 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (ExtIntTriggerMode)
-
287
-
288#elif defined(ARDUINO_ARCH_MEGAAVR)
-
289 // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
-
290 #define RADIOLIB_PLATFORM "MegaCoreX"
+
267 #if defined(ARDUINO_ARCH_MBED)
+
268 // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
269 #define RADIOLIB_TONE_UNSUPPORTED
+
270 #define RADIOLIB_MBED_TONE_OVERRIDE
+
271 #endif
+
272
+
273#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_PORTENTA_H7)
+
274 // Arduino Portenta H7
+
275 #define RADIOLIB_PLATFORM "Portenta H7"
+
276 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
277 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
278 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
279
+
280 #if defined(ARDUINO_ARCH_MBED)
+
281 // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
282 #define RADIOLIB_TONE_UNSUPPORTED
+
283 #define RADIOLIB_MBED_TONE_OVERRIDE
+
284 #endif
+
285
+
286#elif defined(__STM32F4__) || defined(__STM32F1__)
+
287 // Arduino STM32 core by Roger Clark (https://github.com/rogerclarkmelbourne/Arduino_STM32)
+
288 #define RADIOLIB_PLATFORM "STM32duino (unofficial)"
+
289 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (WiringPinMode)
+
290 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (ExtIntTriggerMode)
291
-
292#elif defined(ARDUINO_ARCH_MBED_RP2040)
-
293 // Raspberry Pi Pico (official mbed core)
-
294 #define RADIOLIB_PLATFORM "Raspberry Pi Pico"
-
295 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
296 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
297 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
298
-
299 // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
-
300 #define RADIOLIB_TONE_UNSUPPORTED
-
301 #define RADIOLIB_MBED_TONE_OVERRIDE
+
292#elif defined(ARDUINO_ARCH_MEGAAVR)
+
293 // MegaCoreX by MCUdude (https://github.com/MCUdude/MegaCoreX)
+
294 #define RADIOLIB_PLATFORM "MegaCoreX"
+
295
+
296#elif defined(ARDUINO_ARCH_MBED_RP2040)
+
297 // Raspberry Pi Pico (official mbed core)
+
298 #define RADIOLIB_PLATFORM "Raspberry Pi Pico"
+
299 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
300 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
301 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
302
-
303#elif defined(ARDUINO_ARCH_RP2040)
-
304 // Raspberry Pi Pico (unofficial core)
-
305 #define RADIOLIB_PLATFORM "Raspberry Pi Pico (unofficial)"
-
306 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
307 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
308 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
309
-
310#elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
-
311 // CubeCell
-
312 #define RADIOLIB_PLATFORM "CubeCell"
-
313 #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(1000000, MSBFIRST, SPI_MODE0) // see issue #709
-
314 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE)
-
315 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes)
-
316
-
317 // CubeCell doesn't seem to define nullptr, let's do something like that now
-
318 #define nullptr NULL
-
319
-
320 // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
-
321 #undef pinMode
-
322
-
323 // ... and uses an outdated GCC which does not support type aliases
-
324 #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
-
325
-
326 // ... and it also has no tone(). This platform was designed by an idiot.
-
327 #define RADIOLIB_TONE_UNSUPPORTED
-
328
-
329 // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
-
330 #define RADIOLIB_YIELD_UNSUPPORTED
-
331 #if defined(yield)
-
332 #undef yield
-
333 #endif
-
334
-
335#elif defined(RASPI)
-
336 // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
-
337 #define RADIOLIB_PLATFORM "RasPiArduino"
+
303 // Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
+
304 #define RADIOLIB_TONE_UNSUPPORTED
+
305 #define RADIOLIB_MBED_TONE_OVERRIDE
+
306
+
307#elif defined(ARDUINO_ARCH_RP2040)
+
308 // Raspberry Pi Pico (unofficial core)
+
309 #define RADIOLIB_PLATFORM "Raspberry Pi Pico (unofficial)"
+
310 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
311 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
312 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
313
+
314#elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
+
315 // CubeCell
+
316 #define RADIOLIB_PLATFORM "CubeCell"
+
317 #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(1000000, MSBFIRST, SPI_MODE0) // see issue #709
+
318 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE)
+
319 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes)
+
320
+
321 // CubeCell doesn't seem to define nullptr, let's do something like that now
+
322 #define nullptr NULL
+
323
+
324 // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
+
325 #undef pinMode
+
326
+
327 // ... and uses an outdated GCC which does not support type aliases
+
328 #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
+
329
+
330 // ... and it also has no tone(). This platform was designed by an idiot.
+
331 #define RADIOLIB_TONE_UNSUPPORTED
+
332
+
333 // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
+
334 #define RADIOLIB_YIELD_UNSUPPORTED
+
335 #if defined(yield)
+
336 #undef yield
+
337 #endif
338
-
339 // let's start off easy - no tone on this platform, that can happen
-
340 #define RADIOLIB_TONE_UNSUPPORTED
-
341
-
342 // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
-
343 #define RADIOLIB_YIELD_UNSUPPORTED
-
344
-
345 // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
-
346 #define PGM_P const char *
-
347
-
348 // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
-
349 #if defined(millis)
-
350 #undef millis
-
351 inline RadioLibTime_t millis() { return((RadioLibTime_t)(STCV / 1000)); };
-
352 #endif
-
353
-
354 #if defined(micros)
-
355 #undef micros
-
356 inline RadioLibTime_t micros() { return((RadioLibTime_t)(STCV)); };
-
357 #endif
-
358
-
359#elif defined(TEENSYDUINO)
-
360 // Teensy
-
361 #define RADIOLIB_PLATFORM "Teensy"
+
339#elif defined(RASPI)
+
340 // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
+
341 #define RADIOLIB_PLATFORM "RasPiArduino"
+
342
+
343 // let's start off easy - no tone on this platform, that can happen
+
344 #define RADIOLIB_TONE_UNSUPPORTED
+
345
+
346 // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
+
347 #define RADIOLIB_YIELD_UNSUPPORTED
+
348
+
349 // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
+
350 #define PGM_P const char *
+
351
+
352 // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
+
353 #if defined(millis)
+
354 #undef millis
+
355 inline RadioLibTime_t millis() { return((RadioLibTime_t)(STCV / 1000)); };
+
356 #endif
+
357
+
358 #if defined(micros)
+
359 #undef micros
+
360 inline RadioLibTime_t micros() { return((RadioLibTime_t)(STCV)); };
+
361 #endif
362
-
363#elif defined(ARDUINO_ARCH_RENESAS)
-
364 // Arduino Renesas (UNO R4)
-
365 #define RADIOLIB_PLATFORM "Arduino Renesas (UNO R4)"
-
366 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
367 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
368 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
369
-
370#elif defined(ARDUINO_ARCH_SILABS)
-
371 // Silicon Labs Arduino
-
372 #define RADIOLIB_PLATFORM "Arduino Silicon Labs"
-
373 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
-
374 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
-
375 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
-
376
-
377#else
-
378 // other Arduino platforms not covered by the above list - this may or may not work
-
379 #define RADIOLIB_PLATFORM "Unknown Arduino"
-
380 #define RADIOLIB_UNKNOWN_PLATFORM
-
381
-
382#endif
-
383
-
384 // set the default values for all macros
-
385 // these will be applied if they were not defined above
-
386 #if !defined(RADIOLIB_NC)
-
387 #define RADIOLIB_NC (0xFFFFFFFF)
-
388 #endif
-
389
-
390 #if !defined(RADIOLIB_DEFAULT_SPI)
-
391 #define RADIOLIB_DEFAULT_SPI SPI
+
363#elif defined(TEENSYDUINO)
+
364 // Teensy
+
365 #define RADIOLIB_PLATFORM "Teensy"
+
366
+
367#elif defined(ARDUINO_ARCH_RENESAS)
+
368 // Arduino Renesas (UNO R4)
+
369 #define RADIOLIB_PLATFORM "Arduino Renesas (UNO R4)"
+
370 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
371 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
372 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
373
+
374#elif defined(ARDUINO_ARCH_SILABS)
+
375 // Silicon Labs Arduino
+
376 #define RADIOLIB_PLATFORM "Arduino Silicon Labs"
+
377 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
+
378 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
+
379 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+
380
+
381#else
+
382 // other Arduino platforms not covered by the above list - this may or may not work
+
383 #define RADIOLIB_PLATFORM "Unknown Arduino"
+
384 #define RADIOLIB_UNKNOWN_PLATFORM
+
385
+
386#endif
+
387
+
388 // set the default values for all macros
+
389 // these will be applied if they were not defined above
+
390 #if !defined(RADIOLIB_NC)
+
391 #define RADIOLIB_NC (0xFFFFFFFF)
392 #endif
393
-
394 #if !defined(RADIOLIB_DEFAULT_SPI_SETTINGS)
-
395 #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
394 #if !defined(RADIOLIB_DEFAULT_SPI)
+
395 #define RADIOLIB_DEFAULT_SPI SPI
396 #endif
397
-
398 #if !defined(RADIOLIB_NONVOLATILE)
-
399 #define RADIOLIB_NONVOLATILE PROGMEM
+
398 #if !defined(RADIOLIB_DEFAULT_SPI_SETTINGS)
+
399 #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
400 #endif
401
-
402 #if !defined(RADIOLIB_NONVOLATILE_PTR)
-
403 #define RADIOLIB_NONVOLATILE_PTR PGM_P
+
402 #if !defined(RADIOLIB_NONVOLATILE)
+
403 #define RADIOLIB_NONVOLATILE PROGMEM
404 #endif
405
-
406 #if !defined(RADIOLIB_NONVOLATILE_READ_BYTE)
-
407 #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
406 #if !defined(RADIOLIB_NONVOLATILE_PTR)
+
407 #define RADIOLIB_NONVOLATILE_PTR PGM_P
408 #endif
409
-
410 #if !defined(RADIOLIB_NONVOLATILE_READ_DWORD)
-
411 #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
+
410 #if !defined(RADIOLIB_NONVOLATILE_READ_BYTE)
+
411 #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
412 #endif
413
-
414 #if !defined(RADIOLIB_TYPE_ALIAS)
-
415 #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
414 #if !defined(RADIOLIB_NONVOLATILE_READ_DWORD)
+
415 #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) pgm_read_dword(addr)
416 #endif
417
-
418 #if !defined(RADIOLIB_ARDUINOHAL_PIN_MODE_CAST)
-
419 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
+
418 #if !defined(RADIOLIB_TYPE_ALIAS)
+
419 #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
420 #endif
421
-
422 #if !defined(RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST)
-
423 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
+
422 #if !defined(RADIOLIB_ARDUINOHAL_PIN_MODE_CAST)
+
423 #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST
424 #endif
425
-
426 #if !defined(RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST)
-
427 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
+
426 #if !defined(RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST)
+
427 #define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST
428 #endif
429
-
430#else
-
431 // generic non-Arduino platform
-
432 #define RADIOLIB_PLATFORM "Generic"
+
430 #if !defined(RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST)
+
431 #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST
+
432 #endif
433
-
434 #define RADIOLIB_NC (0xFFFFFFFF)
-
435 #define RADIOLIB_NONVOLATILE
-
436 #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) (*(reinterpret_cast<uint8_t *>(reinterpret_cast<void *>(addr))))
-
437 #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) (*(reinterpret_cast<uint32_t *>(reinterpret_cast<void *>(addr))))
-
438 #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
439
-
440 #define DEC 10
-
441 #define HEX 16
-
442 #define OCT 8
-
443 #define BIN 2
-
444
-
445 #include <stdint.h>
-
446
-
447#endif
+
434#else
+
435 // generic non-Arduino platform
+
436 #define RADIOLIB_PLATFORM "Generic"
+
437
+
438 #define RADIOLIB_NC (0xFFFFFFFF)
+
439 #define RADIOLIB_NONVOLATILE
+
440 #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) (*(reinterpret_cast<uint8_t *>(reinterpret_cast<void *>(addr))))
+
441 #define RADIOLIB_NONVOLATILE_READ_DWORD(addr) (*(reinterpret_cast<uint32_t *>(reinterpret_cast<void *>(addr))))
+
442 #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
443
+
444 #define DEC 10
+
445 #define HEX 16
+
446 #define OCT 8
+
447 #define BIN 2
448
-
449// This only compiles on STM32 boards with SUBGHZ module, but also
-
450// include when generating docs
-
451#if (!defined(ARDUINO_ARCH_STM32) || !defined(SUBGHZSPI_BASE)) && !defined(DOXYGEN)
-
452 #define RADIOLIB_EXCLUDE_STM32WLX (1)
-
453#endif
-
454
-
455// if verbose assert is enabled, enable basic debug too
-
456#if RADIOLIB_VERBOSE_ASSERT
-
457 #define RADIOLIB_DEBUG (1)
-
458#endif
-
459
-
460// set the global debug mode flag
-
461#if RADIOLIB_DEBUG_BASIC || RADIOLIB_DEBUG_PROTOCOL || RADIOLIB_DEBUG_SPI
-
462 #define RADIOLIB_DEBUG (1)
-
463#else
-
464 #define RADIOLIB_DEBUG (0)
-
465#endif
-
466
-
467#if RADIOLIB_DEBUG
-
468 #if defined(RADIOLIB_BUILD_ARDUINO)
-
469 #define RADIOLIB_DEBUG_PRINT(...) rlb_printf(__VA_ARGS__)
-
470 #define RADIOLIB_DEBUG_PRINTLN(M, ...) rlb_printf(M "\n", ##__VA_ARGS__)
-
471 #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) rlb_printf(LEVEL "" M, ##__VA_ARGS__)
-
472 #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) rlb_printf(LEVEL "" M "\n", ##__VA_ARGS__)
-
473
-
474 // some platforms do not support printf("%f"), so it has to be done this way
-
475 #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL); RADIOLIB_DEBUG_PORT.print(VAL, DECIMALS)
-
476 #else
-
477 #if !defined(RADIOLIB_DEBUG_PRINT)
-
478 #define RADIOLIB_DEBUG_PRINT(...) fprintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__)
-
479 #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M, ##__VA_ARGS__)
-
480 #endif
-
481 #if !defined(RADIOLIB_DEBUG_PRINTLN)
-
482 #define RADIOLIB_DEBUG_PRINTLN(M, ...) fprintf(RADIOLIB_DEBUG_PORT, M "\n", ##__VA_ARGS__)
-
483 #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M "\n", ##__VA_ARGS__)
+
449 #include <stdint.h>
+
450
+
451#endif
+
452
+
453// This only compiles on STM32 boards with SUBGHZ module, but also
+
454// include when generating docs
+
455#if (!defined(ARDUINO_ARCH_STM32) || !defined(SUBGHZSPI_BASE)) && !defined(DOXYGEN)
+
456 #define RADIOLIB_EXCLUDE_STM32WLX (1)
+
457#endif
+
458
+
459// if verbose assert is enabled, enable basic debug too
+
460#if RADIOLIB_VERBOSE_ASSERT
+
461 #define RADIOLIB_DEBUG (1)
+
462#endif
+
463
+
464// set the global debug mode flag
+
465#if RADIOLIB_DEBUG_BASIC || RADIOLIB_DEBUG_PROTOCOL || RADIOLIB_DEBUG_SPI
+
466 #define RADIOLIB_DEBUG (1)
+
467#else
+
468 #define RADIOLIB_DEBUG (0)
+
469#endif
+
470
+
471#if RADIOLIB_DEBUG
+
472 #if defined(RADIOLIB_BUILD_ARDUINO)
+
473 #define RADIOLIB_DEBUG_PRINT(...) rlb_printf(__VA_ARGS__)
+
474 #define RADIOLIB_DEBUG_PRINTLN(M, ...) rlb_printf(M "\n", ##__VA_ARGS__)
+
475 #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) rlb_printf(LEVEL "" M, ##__VA_ARGS__)
+
476 #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) rlb_printf(LEVEL "" M "\n", ##__VA_ARGS__)
+
477
+
478 // some platforms do not support printf("%f"), so it has to be done this way
+
479 #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL); RADIOLIB_DEBUG_PORT.print(VAL, DECIMALS)
+
480 #else
+
481 #if !defined(RADIOLIB_DEBUG_PRINT)
+
482 #define RADIOLIB_DEBUG_PRINT(...) fprintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__)
+
483 #define RADIOLIB_DEBUG_PRINT_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M, ##__VA_ARGS__)
484 #endif
-
485 #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL "%.3f", VAL)
-
486 #endif
-
487
-
488 #define RADIOLIB_DEBUG_HEXDUMP(LEVEL, ...) rlb_hexdump(LEVEL, __VA_ARGS__)
-
489#else
-
490 #define RADIOLIB_DEBUG_PRINT(...) {}
-
491 #define RADIOLIB_DEBUG_PRINTLN(...) {}
-
492 #define RADIOLIB_DEBUG_PRINT_FLOAT(VAL, DECIMALS) {}
-
493 #define RADIOLIB_DEBUG_HEXDUMP(...) {}
-
494#endif
-
495
-
496#if RADIOLIB_DEBUG_BASIC
-
497 #define RADIOLIB_DEBUG_BASIC_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_DBG: ", __VA_ARGS__)
-
498 #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
-
499 #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_DBG: ", __VA_ARGS__)
-
500 #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_DBG: ", __VA_ARGS__);
-
501 #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_DBG: ", __VA_ARGS__);
-
502#else
-
503 #define RADIOLIB_DEBUG_BASIC_PRINT(...) {}
-
504 #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) {}
-
505 #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) {}
-
506 #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) {}
-
507 #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) {}
-
508#endif
-
509
-
510#if RADIOLIB_DEBUG_PROTOCOL
-
511 #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_PRO: ", __VA_ARGS__)
-
512 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
-
513 #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_PRO: ", __VA_ARGS__)
-
514 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_PRO: ", __VA_ARGS__);
-
515 #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_PRO: ", __VA_ARGS__);
-
516#else
-
517 #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) {}
-
518 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_NOTAG(...) {}
-
519 #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) {}
-
520 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) {}
-
521 #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) {}
-
522#endif
-
523
-
524#if RADIOLIB_DEBUG_SPI
-
525 #define RADIOLIB_DEBUG_SPI_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_SPI: ", __VA_ARGS__)
-
526 #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
-
527 #define RADIOLIB_DEBUG_SPI_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_SPI: ", __VA_ARGS__)
-
528 #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) RADIOLIB_DEBUG_PRINTLN_LVL("", __VA_ARGS__)
-
529 #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_SPI: ", __VA_ARGS__);
-
530 #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_SPI: ", __VA_ARGS__);
-
531#else
-
532 #define RADIOLIB_DEBUG_SPI_PRINT(...) {}
-
533 #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) {}
-
534 #define RADIOLIB_DEBUG_SPI_PRINTLN(...) {}
-
535 #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) {}
-
536 #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) {}
-
537 #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) {}
-
538#endif
-
539
-
540// debug info strings
-
541#define RADIOLIB_VALUE_TO_STRING(x) #x
-
542#define RADIOLIB_VALUE(x) RADIOLIB_VALUE_TO_STRING(x)
+
485 #if !defined(RADIOLIB_DEBUG_PRINTLN)
+
486 #define RADIOLIB_DEBUG_PRINTLN(M, ...) fprintf(RADIOLIB_DEBUG_PORT, M "\n", ##__VA_ARGS__)
+
487 #define RADIOLIB_DEBUG_PRINTLN_LVL(LEVEL, M, ...) fprintf(RADIOLIB_DEBUG_PORT, LEVEL "" M "\n", ##__VA_ARGS__)
+
488 #endif
+
489 #define RADIOLIB_DEBUG_PRINT_FLOAT(LEVEL, VAL, DECIMALS) RADIOLIB_DEBUG_PRINT(LEVEL "%.3f", VAL)
+
490 #endif
+
491
+
492 #define RADIOLIB_DEBUG_HEXDUMP(LEVEL, ...) rlb_hexdump(LEVEL, __VA_ARGS__)
+
493#else
+
494 #define RADIOLIB_DEBUG_PRINT(...) {}
+
495 #define RADIOLIB_DEBUG_PRINTLN(...) {}
+
496 #define RADIOLIB_DEBUG_PRINT_FLOAT(VAL, DECIMALS) {}
+
497 #define RADIOLIB_DEBUG_HEXDUMP(...) {}
+
498#endif
+
499
+
500#if RADIOLIB_DEBUG_BASIC
+
501 #define RADIOLIB_DEBUG_BASIC_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_DBG: ", __VA_ARGS__)
+
502 #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
+
503 #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_DBG: ", __VA_ARGS__)
+
504 #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_DBG: ", __VA_ARGS__);
+
505 #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_DBG: ", __VA_ARGS__);
+
506#else
+
507 #define RADIOLIB_DEBUG_BASIC_PRINT(...) {}
+
508 #define RADIOLIB_DEBUG_BASIC_PRINT_NOTAG(...) {}
+
509 #define RADIOLIB_DEBUG_BASIC_PRINTLN(...) {}
+
510 #define RADIOLIB_DEBUG_BASIC_PRINT_FLOAT(...) {}
+
511 #define RADIOLIB_DEBUG_BASIC_HEXDUMP(...) {}
+
512#endif
+
513
+
514#if RADIOLIB_DEBUG_PROTOCOL
+
515 #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_PRO: ", __VA_ARGS__)
+
516 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
+
517 #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_PRO: ", __VA_ARGS__)
+
518 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_PRO: ", __VA_ARGS__);
+
519 #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_PRO: ", __VA_ARGS__);
+
520#else
+
521 #define RADIOLIB_DEBUG_PROTOCOL_PRINT(...) {}
+
522 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_NOTAG(...) {}
+
523 #define RADIOLIB_DEBUG_PROTOCOL_PRINTLN(...) {}
+
524 #define RADIOLIB_DEBUG_PROTOCOL_PRINT_FLOAT(...) {}
+
525 #define RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(...) {}
+
526#endif
+
527
+
528#if RADIOLIB_DEBUG_SPI
+
529 #define RADIOLIB_DEBUG_SPI_PRINT(...) RADIOLIB_DEBUG_PRINT_LVL("RLB_SPI: ", __VA_ARGS__)
+
530 #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) RADIOLIB_DEBUG_PRINT_LVL("", __VA_ARGS__)
+
531 #define RADIOLIB_DEBUG_SPI_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN_LVL("RLB_SPI: ", __VA_ARGS__)
+
532 #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) RADIOLIB_DEBUG_PRINTLN_LVL("", __VA_ARGS__)
+
533 #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) RADIOLIB_DEBUG_PRINT_FLOAT("RLB_SPI: ", __VA_ARGS__);
+
534 #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) RADIOLIB_DEBUG_HEXDUMP("RLB_SPI: ", __VA_ARGS__);
+
535#else
+
536 #define RADIOLIB_DEBUG_SPI_PRINT(...) {}
+
537 #define RADIOLIB_DEBUG_SPI_PRINT_NOTAG(...) {}
+
538 #define RADIOLIB_DEBUG_SPI_PRINTLN(...) {}
+
539 #define RADIOLIB_DEBUG_SPI_PRINTLN_NOTAG(...) {}
+
540 #define RADIOLIB_DEBUG_SPI_PRINT_FLOAT(...) {}
+
541 #define RADIOLIB_DEBUG_SPI_HEXDUMP(...) {}
+
542#endif
543
-
544#define RADIOLIB_INFO "\nRadioLib Info\nVersion: \"" \
-
545 RADIOLIB_VALUE(RADIOLIB_VERSION_MAJOR) "." \
-
546 RADIOLIB_VALUE(RADIOLIB_VERSION_MINOR) "." \
-
547 RADIOLIB_VALUE(RADIOLIB_VERSION_PATCH) "." \
-
548 RADIOLIB_VALUE(RADIOLIB_VERSION_EXTRA) "\"\n" \
-
549 "Platform: " RADIOLIB_VALUE(RADIOLIB_PLATFORM) "\n" \
-
550 "Compiled: " RADIOLIB_VALUE(__DATE__) " " RADIOLIB_VALUE(__TIME__)
-
551
-
557#if RADIOLIB_VERBOSE_ASSERT
-
558#define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { RADIOLIB_DEBUG_BASIC_PRINTLN("%d at %s:%d", STATEVAR, __FILE__, __LINE__); return(STATEVAR); } }
-
559#define RADIOLIB_ASSERT_PTR(PTR) { if((PTR) == NULL) { RADIOLIB_DEBUG_BASIC_PRINTLN("NULL at %s:%d", __FILE__, __LINE__); return(RADIOLIB_ERR_MEMORY_ALLOCATION_FAILED); } }
-
560#else
-
561#define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
-
562#define RADIOLIB_ASSERT_PTR(PTR) { if((PTR) == NULL) { return(RADIOLIB_ERR_MEMORY_ALLOCATION_FAILED); } }
-
563#endif
-
564
-
568#if RADIOLIB_CHECK_PARAMS
-
569 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
-
570#else
-
571 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
-
572#endif
-
573
-
574#if RADIOLIB_FIX_ERRATA_SX127X
-
575 #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
-
576#else
-
577 #define RADIOLIB_ERRATA_SX127X(...) {}
-
578#endif
-
579
-
580// these macros are usually defined by Arduino, but some platforms undef them, so its safer to use our own
-
581#define RADIOLIB_MIN(a,b) ((a)<(b)?(a):(b))
-
582#define RADIOLIB_MAX(a,b) ((a)>(b)?(a):(b))
-
583#define RADIOLIB_ABS(x) ((x)>0?(x):-(x))
-
584
-
585// version definitions
-
586#define RADIOLIB_VERSION_MAJOR 7
-
587#define RADIOLIB_VERSION_MINOR 1
-
588#define RADIOLIB_VERSION_PATCH 2
-
589#define RADIOLIB_VERSION_EXTRA 0
-
590
-
591#define RADIOLIB_VERSION (((RADIOLIB_VERSION_MAJOR) << 24) | ((RADIOLIB_VERSION_MINOR) << 16) | ((RADIOLIB_VERSION_PATCH) << 8) | (RADIOLIB_VERSION_EXTRA))
-
592
-
593#endif
+
544// debug info strings
+
545#define RADIOLIB_VALUE_TO_STRING(x) #x
+
546#define RADIOLIB_VALUE(x) RADIOLIB_VALUE_TO_STRING(x)
+
547
+
548#define RADIOLIB_INFO "\nRadioLib Info\nVersion: \"" \
+
549 RADIOLIB_VALUE(RADIOLIB_VERSION_MAJOR) "." \
+
550 RADIOLIB_VALUE(RADIOLIB_VERSION_MINOR) "." \
+
551 RADIOLIB_VALUE(RADIOLIB_VERSION_PATCH) "." \
+
552 RADIOLIB_VALUE(RADIOLIB_VERSION_EXTRA) "\"\n" \
+
553 "Platform: " RADIOLIB_VALUE(RADIOLIB_PLATFORM) "\n" \
+
554 "Compiled: " RADIOLIB_VALUE(__DATE__) " " RADIOLIB_VALUE(__TIME__)
+
555
+
561#if RADIOLIB_VERBOSE_ASSERT
+
562#define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { RADIOLIB_DEBUG_BASIC_PRINTLN("%d at %s:%d", STATEVAR, __FILE__, __LINE__); return(STATEVAR); } }
+
563#define RADIOLIB_ASSERT_PTR(PTR) { if((PTR) == NULL) { RADIOLIB_DEBUG_BASIC_PRINTLN("NULL at %s:%d", __FILE__, __LINE__); return(RADIOLIB_ERR_MEMORY_ALLOCATION_FAILED); } }
+
564#else
+
565#define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
+
566#define RADIOLIB_ASSERT_PTR(PTR) { if((PTR) == NULL) { return(RADIOLIB_ERR_MEMORY_ALLOCATION_FAILED); } }
+
567#endif
+
568
+
572#if RADIOLIB_CHECK_PARAMS
+
573 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
+
574#else
+
575 #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
+
576#endif
+
577
+
578#if RADIOLIB_FIX_ERRATA_SX127X
+
579 #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
+
580#else
+
581 #define RADIOLIB_ERRATA_SX127X(...) {}
+
582#endif
+
583
+
584// these macros are usually defined by Arduino, but some platforms undef them, so its safer to use our own
+
585#define RADIOLIB_MIN(a,b) ((a)<(b)?(a):(b))
+
586#define RADIOLIB_MAX(a,b) ((a)>(b)?(a):(b))
+
587#define RADIOLIB_ABS(x) ((x)>0?(x):-(x))
+
588
+
589// version definitions
+
590#define RADIOLIB_VERSION_MAJOR 7
+
591#define RADIOLIB_VERSION_MINOR 1
+
592#define RADIOLIB_VERSION_PATCH 2
+
593#define RADIOLIB_VERSION_EXTRA 0
+
594
+
595#define RADIOLIB_VERSION (((RADIOLIB_VERSION_MAJOR) << 24) | ((RADIOLIB_VERSION_MINOR) << 16) | ((RADIOLIB_VERSION_PATCH) << 8) | (RADIOLIB_VERSION_EXTRA))
+
596
+
597#endif
unsigned long RadioLibTime_t
Type used for durations in RadioLib.
Definition TypeDef.h:642