From b835b6c3a1adfb7d81094369751f8162c520c127 Mon Sep 17 00:00:00 2001 From: jgromes Date: Wed, 14 Dec 2022 21:38:06 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20947ff?= =?UTF-8?q?48df64886cb80a277ec6b5899b92e5ce509=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 | 723 ++++++++++++++++++++------------------ 1 file changed, 379 insertions(+), 344 deletions(-) diff --git a/_build_opt_8h_source.html b/_build_opt_8h_source.html index b7519cb0..0b479d01 100644 --- a/_build_opt_8h_source.html +++ b/_build_opt_8h_source.html @@ -732,8 +732,8 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html',''); initRe
644  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
645  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
646 
-
647  #elif defined(ARDUINO_ARCH_RP2040)
-
648  // Raspberry Pi Pico
+
647  #elif defined(ARDUINO_ARCH_MBED_RP2040)
+
648  // Raspberry Pi Pico (official mbed core)
649  #define RADIOLIB_PLATFORM "Raspberry Pi Pico"
650  #define RADIOLIB_PIN_TYPE pin_size_t
651  #define RADIOLIB_PIN_MODE PinMode
@@ -771,364 +771,399 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html',''); initRe
683  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
684  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
685 
-
686  #elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
-
687  // CubeCell
-
688  #define RADIOLIB_PLATFORM "CubeCell"
-
689  #define RADIOLIB_PIN_TYPE uint8_t
-
690  #define RADIOLIB_PIN_MODE PINMODE
-
691  #define RADIOLIB_PIN_STATUS uint8_t
-
692  #define RADIOLIB_INTERRUPT_STATUS IrqModes
+
686  #elif defined(ARDUINO_ARCH_RP2040)
+
687  // Raspberry Pi Pico (unofficial core)
+
688  #define RADIOLIB_PLATFORM "Raspberry Pi Pico (unofficial)"
+
689  #define RADIOLIB_PIN_TYPE pin_size_t
+
690  #define RADIOLIB_PIN_MODE PinMode
+
691  #define RADIOLIB_PIN_STATUS PinStatus
+
692  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
693  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
694  #define RADIOLIB_NC (0xFF)
695  #define RADIOLIB_DEFAULT_SPI SPI
696  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
697  #define RADIOLIB_NONVOLATILE PROGMEM
698  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
699 
-
700  // Arduino API callbacks
-
701  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, PINMODE mode)
-
702  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin_name, uint8_t level)
-
703  #define RADIOLIB_CB_ARGS_DIGITAL_READ (uint8_t, digitalRead, uint8_t pin_name)
-
704  #define RADIOLIB_CB_ARGS_TONE (void, tone, void)
-
705  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, void)
-
706  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t pin_name, GpioIrqHandler GpioIrqHandlerCallback, IrqModes interrupt_mode)
-
707  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t pin_name)
-
708  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
-
709  #define RADIOLIB_CB_ARGS_DELAY (void, delay, uint32_t milliseconds)
-
710  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, uint16 microseconds)
-
711  #define RADIOLIB_CB_ARGS_MILLIS (uint32_t, millis, void)
-
712  #define RADIOLIB_CB_ARGS_MICROS (uint32_t, micros, void)
-
713  #define RADIOLIB_CB_ARGS_PULSE_IN (uint32_t, pulseIn, uint8_t pin_name, uint8_t mode, uint32_t timeout)
-
714  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
-
715  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
-
716  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
-
717  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
-
718  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
-
719 
-
720  // provide an easy access to the on-board module
-
721  #include "board-config.h"
-
722  #define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY
-
723 
-
724  // CubeCell doesn't seem to define nullptr, let's do something like that now
-
725  #define nullptr NULL
-
726 
-
727  // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
-
728  #undef pinMode
-
729 
-
730  // ... and uses an outdated GCC which does not support type aliases
-
731  #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
-
732 
-
733  // ... and it also has no tone(). This platform was designed by an idiot.
-
734  #define RADIOLIB_TONE_UNSUPPORTED
-
735 
-
736  // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
-
737  #define RADIOLIB_YIELD_UNSUPPORTED
-
738  #if defined(yield)
-
739  #undef yield
-
740  #endif
-
741 
-
742  #elif defined(RASPI)
-
743  // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
-
744  #define RADIOLIB_PLATFORM "RasPiArduino"
-
745  #define RADIOLIB_PIN_TYPE uint8_t
-
746  #define RADIOLIB_PIN_MODE uint8_t
-
747  #define RADIOLIB_PIN_STATUS uint8_t
-
748  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
-
749  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
-
750  #define RADIOLIB_NC (0xFF)
-
751  #define RADIOLIB_DEFAULT_SPI SPI
-
752  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
-
753  #define RADIOLIB_NONVOLATILE PROGMEM
-
754  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
755  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
756 
-
757  // Arduino API callbacks
-
758  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
-
759  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
-
760  #define RADIOLIB_CB_ARGS_DIGITAL_READ (int, digitalRead, uint8_t pin)
-
761  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, unsigned int frequency, unsigned long duration)
-
762  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
-
763  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
-
764  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
-
765  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
-
766  #define RADIOLIB_CB_ARGS_DELAY (void, delay, uint32_t ms)
-
767  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
-
768  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
-
769  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
-
770  #define RADIOLIB_CB_ARGS_PULSE_IN (unsigned long, pulseIn, uint8_t pin, uint8_t state, unsigned long timeout)
-
771  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
-
772  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
-
773  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
-
774  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
-
775  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
699  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
700 
+
701  // Arduino API callbacks
+
702  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, pin_size_t pin, PinMode mode)
+
703  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, pin_size_t pin, PinStatus val)
+
704  #define RADIOLIB_CB_ARGS_DIGITAL_READ (PinStatus, digitalRead, pin_size_t pin)
+
705  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t pin, unsigned int frequency, unsigned long duration)
+
706  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t pin)
+
707  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, pin_size_t interruptNum, voidFuncPtr func, PinStatus mode)
+
708  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, pin_size_t interruptNum)
+
709  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
+
710  #define RADIOLIB_CB_ARGS_DELAY (void, delay, unsigned long ms)
+
711  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
+
712  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
+
713  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
+
714  #define RADIOLIB_CB_ARGS_PULSE_IN (unsigned long, pulseIn, pin_size_t pin, uint8_t state, unsigned long timeout)
+
715  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
+
716  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
+
717  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
+
718  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
+
719  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
720 
+
721  #elif defined(__ASR6501__) || defined(ARDUINO_ARCH_ASR650X) || defined(DARDUINO_ARCH_ASR6601)
+
722  // CubeCell
+
723  #define RADIOLIB_PLATFORM "CubeCell"
+
724  #define RADIOLIB_PIN_TYPE uint8_t
+
725  #define RADIOLIB_PIN_MODE PINMODE
+
726  #define RADIOLIB_PIN_STATUS uint8_t
+
727  #define RADIOLIB_INTERRUPT_STATUS IrqModes
+
728  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
+
729  #define RADIOLIB_NC (0xFF)
+
730  #define RADIOLIB_DEFAULT_SPI SPI
+
731  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
732  #define RADIOLIB_NONVOLATILE PROGMEM
+
733  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
734 
+
735  // Arduino API callbacks
+
736  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, PINMODE mode)
+
737  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin_name, uint8_t level)
+
738  #define RADIOLIB_CB_ARGS_DIGITAL_READ (uint8_t, digitalRead, uint8_t pin_name)
+
739  #define RADIOLIB_CB_ARGS_TONE (void, tone, void)
+
740  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, void)
+
741  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t pin_name, GpioIrqHandler GpioIrqHandlerCallback, IrqModes interrupt_mode)
+
742  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t pin_name)
+
743  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
+
744  #define RADIOLIB_CB_ARGS_DELAY (void, delay, uint32_t milliseconds)
+
745  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, uint16 microseconds)
+
746  #define RADIOLIB_CB_ARGS_MILLIS (uint32_t, millis, void)
+
747  #define RADIOLIB_CB_ARGS_MICROS (uint32_t, micros, void)
+
748  #define RADIOLIB_CB_ARGS_PULSE_IN (uint32_t, pulseIn, uint8_t pin_name, uint8_t mode, uint32_t timeout)
+
749  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
+
750  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
+
751  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
+
752  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
+
753  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
754 
+
755  // provide an easy access to the on-board module
+
756  #include "board-config.h"
+
757  #define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY
+
758 
+
759  // CubeCell doesn't seem to define nullptr, let's do something like that now
+
760  #define nullptr NULL
+
761 
+
762  // ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
+
763  #undef pinMode
+
764 
+
765  // ... and uses an outdated GCC which does not support type aliases
+
766  #define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
+
767 
+
768  // ... and it also has no tone(). This platform was designed by an idiot.
+
769  #define RADIOLIB_TONE_UNSUPPORTED
+
770 
+
771  // ... AND as the (hopefully) final nail in the coffin, IT F*CKING DEFINES YIELD() AS A MACRO THAT DOES NOTHING!!!
+
772  #define RADIOLIB_YIELD_UNSUPPORTED
+
773  #if defined(yield)
+
774  #undef yield
+
775  #endif
776 
-
777  // let's start off easy - no tone on this platform, that can happen
-
778  #define RADIOLIB_TONE_UNSUPPORTED
-
779 
-
780  // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
-
781  #define RADIOLIB_YIELD_UNSUPPORTED
-
782 
-
783  // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
-
784  #define PGM_P const char *
-
785 
-
786  // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
-
787  #if defined(millis)
-
788  #undef millis
-
789  inline unsigned long millis() { return((unsigned long)(STCV / 1000)); };
-
790  #endif
+
777  #elif defined(RASPI)
+
778  // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
+
779  #define RADIOLIB_PLATFORM "RasPiArduino"
+
780  #define RADIOLIB_PIN_TYPE uint8_t
+
781  #define RADIOLIB_PIN_MODE uint8_t
+
782  #define RADIOLIB_PIN_STATUS uint8_t
+
783  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
+
784  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
+
785  #define RADIOLIB_NC (0xFF)
+
786  #define RADIOLIB_DEFAULT_SPI SPI
+
787  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
788  #define RADIOLIB_NONVOLATILE PROGMEM
+
789  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
790  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
791 
-
792  #if defined(micros)
-
793  #undef micros
-
794  inline unsigned long micros() { return((unsigned long)(STCV)); };
-
795  #endif
-
796 
-
797  #elif defined(TEENSYDUINO)
-
798  // Teensy
-
799  #define RADIOLIB_PLATFORM "Teensy"
-
800  #define RADIOLIB_PIN_TYPE uint8_t
-
801  #define RADIOLIB_PIN_MODE uint8_t
-
802  #define RADIOLIB_PIN_STATUS uint8_t
-
803  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
-
804  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
-
805  #define RADIOLIB_NC (0xFF)
-
806  #define RADIOLIB_DEFAULT_SPI SPI
-
807  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
-
808  #define RADIOLIB_NONVOLATILE PROGMEM
-
809  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
810  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
792  // Arduino API callbacks
+
793  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
+
794  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
+
795  #define RADIOLIB_CB_ARGS_DIGITAL_READ (int, digitalRead, uint8_t pin)
+
796  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, unsigned int frequency, unsigned long duration)
+
797  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
+
798  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
+
799  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
+
800  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
+
801  #define RADIOLIB_CB_ARGS_DELAY (void, delay, uint32_t ms)
+
802  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
+
803  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
+
804  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
+
805  #define RADIOLIB_CB_ARGS_PULSE_IN (unsigned long, pulseIn, uint8_t pin, uint8_t state, unsigned long timeout)
+
806  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
+
807  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
+
808  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
+
809  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
+
810  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
811 
-
812  // Arduino API callbacks
-
813  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
-
814  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
-
815  #define RADIOLIB_CB_ARGS_DIGITAL_READ (uint8_t, digitalRead, uint8_t pin)
-
816  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, short unsigned int frequency, long unsigned int duration)
-
817  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
-
818  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
-
819  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
-
820  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
-
821  #define RADIOLIB_CB_ARGS_DELAY (void, delay, unsigned long ms)
-
822  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, long unsigned int us)
-
823  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
-
824  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
-
825  #define RADIOLIB_CB_ARGS_PULSE_IN (unsigned long, pulseIn, uint8_t pin, uint8_t state, unsigned long timeout)
-
826  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
-
827  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
-
828  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
-
829  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
-
830  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
812  // let's start off easy - no tone on this platform, that can happen
+
813  #define RADIOLIB_TONE_UNSUPPORTED
+
814 
+
815  // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
+
816  #define RADIOLIB_YIELD_UNSUPPORTED
+
817 
+
818  // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
+
819  #define PGM_P const char *
+
820 
+
821  // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
+
822  #if defined(millis)
+
823  #undef millis
+
824  inline unsigned long millis() { return((unsigned long)(STCV / 1000)); };
+
825  #endif
+
826 
+
827  #if defined(micros)
+
828  #undef micros
+
829  inline unsigned long micros() { return((unsigned long)(STCV)); };
+
830  #endif
831 
-
832  #else
-
833  // other Arduino platforms not covered by the above list - this may or may not work
-
834  #define RADIOLIB_PLATFORM "Unknown Arduino"
-
835  #define RADIOLIB_UNKNOWN_PLATFORM
-
836  #define RADIOLIB_PIN_TYPE uint8_t
-
837  #define RADIOLIB_PIN_MODE uint8_t
-
838  #define RADIOLIB_PIN_STATUS uint8_t
-
839  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
-
840  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
-
841  #define RADIOLIB_NC (0xFF)
-
842  #define RADIOLIB_DEFAULT_SPI SPI
-
843  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
-
844  #define RADIOLIB_NONVOLATILE PROGMEM
-
845  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
846  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
847 
-
848  // Arduino API callbacks
-
849  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
-
850  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
-
851  #define RADIOLIB_CB_ARGS_DIGITAL_READ (int, digitalRead, uint8_t pin)
-
852  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, unsigned int frequency, unsigned long duration)
-
853  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
-
854  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
-
855  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
-
856  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
-
857  #define RADIOLIB_CB_ARGS_DELAY (void, delay, unsigned long ms)
-
858  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
-
859  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
-
860  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
-
861  #define RADIOLIB_CB_ARGS_PULSE_IN (unsigned long, pulseIn, uint8_t pin, uint8_t state, unsigned long timeout)
-
862  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
-
863  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
-
864  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
-
865  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
-
866  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
-
867 
-
868  #endif
-
869 #endif
-
870 
-
871 #else
-
872  // generic non-Arduino platform
-
873  #define RADIOLIB_PLATFORM "Generic"
-
874 
-
875  // platform properties may be defined here, or somewhere else in the build system
-
876  #include "noarduino.h"
-
877 
-
878 #endif
-
879 
-
880 /*
-
881  * Uncomment to enable debug output.
-
882  * Warning: Debug output will slow down the whole system significantly.
-
883  * Also, it will result in larger compiled binary.
-
884  * Levels: debug - only main info
-
885  * verbose - full transcript of all SPI communication
-
886  */
-
887 #if !defined(RADIOLIB_DEBUG)
-
888  //#define RADIOLIB_DEBUG
-
889 #endif
-
890 #if !defined(RADIOLIB_VERBOSE)
-
891  //#define RADIOLIB_VERBOSE
-
892 #endif
-
893 
-
894 // set which output port should be used for debug output
-
895 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
-
896 #if !defined(RADIOLIB_DEBUG_PORT)
-
897  #define RADIOLIB_DEBUG_PORT Serial
-
898 #endif
-
899 
-
900 /*
-
901  * Uncomment to enable "paranoid" SPI mode
-
902  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
-
903  * This improves reliablility, but slightly slows down communication.
-
904  * Note: Enabled by default.
-
905  */
-
906 #if !defined(RADIOLIB_SPI_PARANOID)
-
907  #define RADIOLIB_SPI_PARANOID
-
908 #endif
+
832  #elif defined(TEENSYDUINO)
+
833  // Teensy
+
834  #define RADIOLIB_PLATFORM "Teensy"
+
835  #define RADIOLIB_PIN_TYPE uint8_t
+
836  #define RADIOLIB_PIN_MODE uint8_t
+
837  #define RADIOLIB_PIN_STATUS uint8_t
+
838  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
+
839  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
+
840  #define RADIOLIB_NC (0xFF)
+
841  #define RADIOLIB_DEFAULT_SPI SPI
+
842  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
843  #define RADIOLIB_NONVOLATILE PROGMEM
+
844  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
845  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
846 
+
847  // Arduino API callbacks
+
848  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
+
849  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
+
850  #define RADIOLIB_CB_ARGS_DIGITAL_READ (uint8_t, digitalRead, uint8_t pin)
+
851  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, short unsigned int frequency, long unsigned int duration)
+
852  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
+
853  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
+
854  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
+
855  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
+
856  #define RADIOLIB_CB_ARGS_DELAY (void, delay, unsigned long ms)
+
857  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, long unsigned int us)
+
858  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
+
859  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
+
860  #define RADIOLIB_CB_ARGS_PULSE_IN (unsigned long, pulseIn, uint8_t pin, uint8_t state, unsigned long timeout)
+
861  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
+
862  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
+
863  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
+
864  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
+
865  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
866 
+
867  #else
+
868  // other Arduino platforms not covered by the above list - this may or may not work
+
869  #define RADIOLIB_PLATFORM "Unknown Arduino"
+
870  #define RADIOLIB_UNKNOWN_PLATFORM
+
871  #define RADIOLIB_PIN_TYPE uint8_t
+
872  #define RADIOLIB_PIN_MODE uint8_t
+
873  #define RADIOLIB_PIN_STATUS uint8_t
+
874  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
+
875  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
+
876  #define RADIOLIB_NC (0xFF)
+
877  #define RADIOLIB_DEFAULT_SPI SPI
+
878  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
879  #define RADIOLIB_NONVOLATILE PROGMEM
+
880  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
881  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
882 
+
883  // Arduino API callbacks
+
884  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
+
885  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
+
886  #define RADIOLIB_CB_ARGS_DIGITAL_READ (int, digitalRead, uint8_t pin)
+
887  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, unsigned int frequency, unsigned long duration)
+
888  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
+
889  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
+
890  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
+
891  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
+
892  #define RADIOLIB_CB_ARGS_DELAY (void, delay, unsigned long ms)
+
893  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
+
894  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
+
895  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
+
896  #define RADIOLIB_CB_ARGS_PULSE_IN (unsigned long, pulseIn, uint8_t pin, uint8_t state, unsigned long timeout)
+
897  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
+
898  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
+
899  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
+
900  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
+
901  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
902 
+
903  #endif
+
904 #endif
+
905 
+
906 #else
+
907  // generic non-Arduino platform
+
908  #define RADIOLIB_PLATFORM "Generic"
909 
-
910 /*
-
911  * Uncomment to enable parameter range checking
-
912  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
-
913  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
-
914  * possibly leading to bricked module and/or program crashing.
-
915  * Note: Enabled by default.
-
916  */
-
917 #if !defined(RADIOLIB_CHECK_PARAMS)
-
918  #define RADIOLIB_CHECK_PARAMS
-
919 #endif
-
920 
-
921 /*
-
922  * Uncomment to enable SX127x errata fix
-
923  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
-
924  * It should only be enabled if you really are observing some errata-related issue.
-
925  * Note: Disabled by default.
-
926  */
-
927 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
-
928  //#define RADIOLIB_FIX_ERRATA_SX127X
-
929 #endif
-
930 
-
931 /*
-
932  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
-
933  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
-
934  * Failure to heed the above warning may result in bricked module.
-
935  */
-
936 #if !defined(RADIOLIB_GODMODE)
-
937  //#define RADIOLIB_GODMODE
-
938 #endif
-
939 
-
940 /*
-
941  * Uncomment to enable low-level hardware access
-
942  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
-
943  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
-
944  */
-
945 #if !defined(RADIOLIB_LOW_LEVEL)
-
946  //#define RADIOLIB_LOW_LEVEL
-
947 #endif
-
948 
-
949 /*
-
950  * Uncomment to enable pre-defined modules when using RadioShield.
+
910  // platform properties may be defined here, or somewhere else in the build system
+
911  #include "noarduino.h"
+
912 
+
913 #endif
+
914 
+
915 /*
+
916  * Uncomment to enable debug output.
+
917  * Warning: Debug output will slow down the whole system significantly.
+
918  * Also, it will result in larger compiled binary.
+
919  * Levels: debug - only main info
+
920  * verbose - full transcript of all SPI communication
+
921  */
+
922 #if !defined(RADIOLIB_DEBUG)
+
923  //#define RADIOLIB_DEBUG
+
924 #endif
+
925 #if !defined(RADIOLIB_VERBOSE)
+
926  //#define RADIOLIB_VERBOSE
+
927 #endif
+
928 
+
929 // set which output port should be used for debug output
+
930 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
+
931 #if !defined(RADIOLIB_DEBUG_PORT)
+
932  #define RADIOLIB_DEBUG_PORT Serial
+
933 #endif
+
934 
+
935 /*
+
936  * Uncomment to enable "paranoid" SPI mode
+
937  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
+
938  * This improves reliablility, but slightly slows down communication.
+
939  * Note: Enabled by default.
+
940  */
+
941 #if !defined(RADIOLIB_SPI_PARANOID)
+
942  #define RADIOLIB_SPI_PARANOID
+
943 #endif
+
944 
+
945 /*
+
946  * Uncomment to enable parameter range checking
+
947  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
+
948  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
+
949  * possibly leading to bricked module and/or program crashing.
+
950  * Note: Enabled by default.
951  */
-
952 #if !defined(RADIOLIB_RADIOSHIELD)
-
953  //#define RADIOLIB_RADIOSHIELD
+
952 #if !defined(RADIOLIB_CHECK_PARAMS)
+
953  #define RADIOLIB_CHECK_PARAMS
954 #endif
955 
956 /*
-
957  * Uncomment to enable interrupt-based timing control
-
958  * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
-
959  */
-
960 #if !defined(RADIOLIB_INTERRUPT_TIMING)
-
961  //#define RADIOLIB_INTERRUPT_TIMING
-
962 #endif
-
963 
-
964 /*
-
965  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
-
966  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
-
967  */
-
968 #if !defined(RADIOLIB_STATIC_ONLY)
-
969  //#define RADIOLIB_STATIC_ONLY
-
970 #endif
-
971 
-
972 // set the size of static arrays to use
-
973 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
-
974  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
-
975 #endif
-
976 
-
977 #if defined(RADIOLIB_DEBUG)
-
978  #if defined(RADIOLIB_BUILD_ARDUINO)
-
979  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
-
980  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
-
981  #else
-
982  #if !defined(RADIOLIB_DEBUG_PRINT)
-
983  #define RADIOLIB_DEBUG_PRINT(...) { frintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__); }
-
984  #endif
-
985  #if !defined(RADIOLIB_DEBUG_PRINTLN)
-
986  #define RADIOLIB_DEBUG_PRINTLN(...) { printf(RADIOLIB_DEBUG_PORT, __VA_ARGS__ "\n"); }
-
987  #endif
-
988  #endif
-
989 #else
-
990  #define RADIOLIB_DEBUG_PRINT(...) {}
-
991  #define RADIOLIB_DEBUG_PRINTLN(...) {}
-
992 #endif
-
993 
-
994 #if defined(RADIOLIB_VERBOSE)
-
995  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
-
996  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
-
997 #else
-
998  #define RADIOLIB_VERBOSE_PRINT(...) {}
-
999  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
-
1000 #endif
-
1001 
-
1005 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
+
957  * Uncomment to enable SX127x errata fix
+
958  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
+
959  * It should only be enabled if you really are observing some errata-related issue.
+
960  * Note: Disabled by default.
+
961  */
+
962 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
+
963  //#define RADIOLIB_FIX_ERRATA_SX127X
+
964 #endif
+
965 
+
966 /*
+
967  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
+
968  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
+
969  * Failure to heed the above warning may result in bricked module.
+
970  */
+
971 #if !defined(RADIOLIB_GODMODE)
+
972  //#define RADIOLIB_GODMODE
+
973 #endif
+
974 
+
975 /*
+
976  * Uncomment to enable low-level hardware access
+
977  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
+
978  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
+
979  */
+
980 #if !defined(RADIOLIB_LOW_LEVEL)
+
981  //#define RADIOLIB_LOW_LEVEL
+
982 #endif
+
983 
+
984 /*
+
985  * Uncomment to enable pre-defined modules when using RadioShield.
+
986  */
+
987 #if !defined(RADIOLIB_RADIOSHIELD)
+
988  //#define RADIOLIB_RADIOSHIELD
+
989 #endif
+
990 
+
991 /*
+
992  * Uncomment to enable interrupt-based timing control
+
993  * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
+
994  */
+
995 #if !defined(RADIOLIB_INTERRUPT_TIMING)
+
996  //#define RADIOLIB_INTERRUPT_TIMING
+
997 #endif
+
998 
+
999 /*
+
1000  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
+
1001  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
+
1002  */
+
1003 #if !defined(RADIOLIB_STATIC_ONLY)
+
1004  //#define RADIOLIB_STATIC_ONLY
+
1005 #endif
1006 
-
1007 /*
-
1008  * Macros that create callback for the hardware abstraction layer.
-
1009  *
-
1010  * This is the most evil thing I have ever created. I am deeply sorry to anyone currently reading this text.
-
1011  * Come one, come all and witness the horror:
-
1012  * Variadics, forced expansions, inlined function, string concatenation, and it even messes up access specifiers.
-
1013  */
-
1014 #define RADIOLIB_FIRST(arg, ...) arg
-
1015 #define RADIOLIB_REST(arg, ...) __VA_ARGS__
-
1016 #define RADIOLIB_EXP(...) __VA_ARGS__
-
1017 
-
1018 #define RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, FUNC, ...) public: typedef RET (*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
-
1019 #define RADIOLIB_GENERATE_CALLBACK_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, __VA_ARGS__)
-
1020 #define RADIOLIB_GENERATE_CALLBACK(CB) RADIOLIB_GENERATE_CALLBACK_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
-
1021 
-
1022 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, FUNC, ...) public: typedef RET (Module::*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
-
1023 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, __VA_ARGS__)
-
1024 #define RADIOLIB_GENERATE_CALLBACK_SPI(CB) RADIOLIB_GENERATE_CALLBACK_SPI_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
-
1025 
-
1029 #if defined(RADIOLIB_CHECK_PARAMS)
-
1030  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
-
1031 #else
-
1032  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
-
1033 #endif
-
1034 
-
1035 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
-
1036  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
-
1037 #else
-
1038  #define RADIOLIB_ERRATA_SX127X(...) {}
-
1039 #endif
-
1040 
-
1041 // version definitions
-
1042 #define RADIOLIB_VERSION_MAJOR (0x05)
-
1043 #define RADIOLIB_VERSION_MINOR (0x05)
-
1044 #define RADIOLIB_VERSION_PATCH (0x00)
-
1045 #define RADIOLIB_VERSION_EXTRA (0x00)
-
1046 
-
1047 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
-
1048 
-
1049 #endif
+
1007 // set the size of static arrays to use
+
1008 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
+
1009  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
+
1010 #endif
+
1011 
+
1012 #if defined(RADIOLIB_DEBUG)
+
1013  #if defined(RADIOLIB_BUILD_ARDUINO)
+
1014  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
+
1015  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
+
1016  #else
+
1017  #if !defined(RADIOLIB_DEBUG_PRINT)
+
1018  #define RADIOLIB_DEBUG_PRINT(...) { frintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__); }
+
1019  #endif
+
1020  #if !defined(RADIOLIB_DEBUG_PRINTLN)
+
1021  #define RADIOLIB_DEBUG_PRINTLN(...) { printf(RADIOLIB_DEBUG_PORT, __VA_ARGS__ "\n"); }
+
1022  #endif
+
1023  #endif
+
1024 #else
+
1025  #define RADIOLIB_DEBUG_PRINT(...) {}
+
1026  #define RADIOLIB_DEBUG_PRINTLN(...) {}
+
1027 #endif
+
1028 
+
1029 #if defined(RADIOLIB_VERBOSE)
+
1030  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
+
1031  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
+
1032 #else
+
1033  #define RADIOLIB_VERBOSE_PRINT(...) {}
+
1034  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
+
1035 #endif
+
1036 
+
1040 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
+
1041 
+
1042 /*
+
1043  * Macros that create callback for the hardware abstraction layer.
+
1044  *
+
1045  * This is the most evil thing I have ever created. I am deeply sorry to anyone currently reading this text.
+
1046  * Come one, come all and witness the horror:
+
1047  * Variadics, forced expansions, inlined function, string concatenation, and it even messes up access specifiers.
+
1048  */
+
1049 #define RADIOLIB_FIRST(arg, ...) arg
+
1050 #define RADIOLIB_REST(arg, ...) __VA_ARGS__
+
1051 #define RADIOLIB_EXP(...) __VA_ARGS__
+
1052 
+
1053 #define RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, FUNC, ...) public: typedef RET (*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
+
1054 #define RADIOLIB_GENERATE_CALLBACK_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, __VA_ARGS__)
+
1055 #define RADIOLIB_GENERATE_CALLBACK(CB) RADIOLIB_GENERATE_CALLBACK_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
1056 
+
1057 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, FUNC, ...) public: typedef RET (Module::*FUNC##_cb_t)(__VA_ARGS__); void setCb_##FUNC(FUNC##_cb_t cb) { cb_##FUNC = cb; }; private: FUNC##_cb_t cb_##FUNC = nullptr;
+
1058 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, __VA_ARGS__)
+
1059 #define RADIOLIB_GENERATE_CALLBACK_SPI(CB) RADIOLIB_GENERATE_CALLBACK_SPI_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
1060 
+
1064 #if defined(RADIOLIB_CHECK_PARAMS)
+
1065  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
+
1066 #else
+
1067  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
+
1068 #endif
+
1069 
+
1070 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
+
1071  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
+
1072 #else
+
1073  #define RADIOLIB_ERRATA_SX127X(...) {}
+
1074 #endif
+
1075 
+
1076 // version definitions
+
1077 #define RADIOLIB_VERSION_MAJOR (0x05)
+
1078 #define RADIOLIB_VERSION_MINOR (0x05)
+
1079 #define RADIOLIB_VERSION_PATCH (0x00)
+
1080 #define RADIOLIB_VERSION_EXTRA (0x00)
+
1081 
+
1082 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
+
1083 
+
1084 #endif