From be931fb90015cdaa58da4423c6c019f72e0fbcc9 Mon Sep 17 00:00:00 2001 From: jgromes Date: Tue, 28 Dec 2021 12:48:08 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2045670?= =?UTF-8?q?44deb964beadd225b420f651df417a20026=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 | 442 +++++++++++++++++++++----------------- 1 file changed, 248 insertions(+), 194 deletions(-) diff --git a/_build_opt_8h_source.html b/_build_opt_8h_source.html index c03f6298..88958198 100644 --- a/_build_opt_8h_source.html +++ b/_build_opt_8h_source.html @@ -822,208 +822,262 @@ $(document).ready(function(){initNavTree('_build_opt_8h_source.html',''); initRe
734  #undef yield
735  #endif
736 
-
737  #else
-
738  // other Arduino platforms not covered by the above list - this may or may not work
-
739  #define RADIOLIB_PLATFORM "Unknown Arduino"
-
740  #define RADIOLIB_UNKNOWN_PLATFORM
-
741  #define RADIOLIB_PIN_TYPE uint8_t
-
742  #define RADIOLIB_PIN_MODE uint8_t
-
743  #define RADIOLIB_PIN_STATUS uint8_t
-
744  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
-
745  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
-
746  #define RADIOLIB_NC (0xFF)
-
747  #define RADIOLIB_DEFAULT_SPI SPI
-
748  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
-
749  #define RADIOLIB_NONVOLATILE PROGMEM
-
750  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
-
751  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
-
752 
-
753  // Arduino API callbacks
-
754  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
-
755  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
-
756  #define RADIOLIB_CB_ARGS_DIGITAL_READ (int, digitalRead, uint8_t pin)
-
757  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, unsigned int frequency, unsigned long duration)
-
758  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
-
759  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
-
760  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
-
761  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
-
762  #define RADIOLIB_CB_ARGS_DELAY (void, delay, unsigned long ms)
-
763  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
-
764  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
-
765  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
-
766  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
-
767  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
-
768  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
-
769  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
-
770  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
-
771 
-
772  #endif
-
773 #endif
-
774 
-
775 #else
-
776  // generic non-Arduino platform
-
777  #define RADIOLIB_PLATFORM "Generic"
-
778 
-
779  // platform properties may be defined here, or somewhere else in the build system
-
780 
-
781 #endif
-
782 
-
783 /*
-
784  * Uncomment to enable debug output.
-
785  * Warning: Debug output will slow down the whole system significantly.
-
786  * Also, it will result in larger compiled binary.
-
787  * Levels: debug - only main info
-
788  * verbose - full transcript of all SPI communication
-
789  */
-
790 #if !defined(RADIOLIB_DEBUG)
-
791  //#define RADIOLIB_DEBUG
-
792 #endif
-
793 #if !defined(RADIOLIB_VERBOSE)
-
794  //#define RADIOLIB_VERBOSE
-
795 #endif
-
796 
-
797 // set which output port should be used for debug output
-
798 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
-
799 #if !defined(RADIOLIB_DEBUG_PORT)
-
800  #define RADIOLIB_DEBUG_PORT Serial
-
801 #endif
-
802 
-
803 /*
-
804  * Uncomment to enable "paranoid" SPI mode
-
805  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
-
806  * This improves reliablility, but slightly slows down communication.
-
807  * Note: Enabled by default.
-
808  */
-
809 #if !defined(RADIOLIB_SPI_PARANOID)
-
810  #define RADIOLIB_SPI_PARANOID
-
811 #endif
-
812 
-
813 /*
-
814  * Uncomment to enable parameter range checking
-
815  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
-
816  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
-
817  * possibly leading to bricked module and/or program crashing.
-
818  * Note: Enabled by default.
-
819  */
-
820 #if !defined(RADIOLIB_CHECK_PARAMS)
-
821  #define RADIOLIB_CHECK_PARAMS
-
822 #endif
-
823 
-
824 /*
-
825  * Uncomment to enable SX127x errata fix
-
826  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
-
827  * It should only be enabled if you really are observing some errata-related issue.
-
828  * Note: Disabled by default.
-
829  */
-
830 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
-
831  //#define RADIOLIB_FIX_ERRATA_SX127X
-
832 #endif
-
833 
-
834 /*
-
835  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
-
836  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
-
837  * Failure to heed the above warning may result in bricked module.
-
838  */
-
839 #if !defined(RADIOLIB_GODMODE)
-
840  //#define RADIOLIB_GODMODE
-
841 #endif
-
842 
-
843 /*
-
844  * Uncomment to enable low-level hardware access
-
845  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
-
846  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
-
847  */
-
848 #if !defined(RADIOLIB_LOW_LEVEL)
-
849  //#define RADIOLIB_LOW_LEVEL
-
850 #endif
-
851 
-
852 /*
-
853  * Uncomment to enable pre-defined modules when using RadioShield.
-
854  */
-
855 #if !defined(RADIOLIB_RADIOSHIELD)
-
856  //#define RADIOLIB_RADIOSHIELD
-
857 #endif
-
858 
-
859 /*
-
860  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
-
861  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
+
737 #elif defined(RASPI)
+
738  // RaspiDuino framework (https://github.com/me-no-dev/RasPiArduino)
+
739  #define RADIOLIB_PLATFORM "RasPiArduino"
+
740  #define RADIOLIB_PIN_TYPE uint8_t
+
741  #define RADIOLIB_PIN_MODE uint8_t
+
742  #define RADIOLIB_PIN_STATUS uint8_t
+
743  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
+
744  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
+
745  #define RADIOLIB_NC (0xFF)
+
746  #define RADIOLIB_DEFAULT_SPI SPI
+
747  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
748  #define RADIOLIB_NONVOLATILE PROGMEM
+
749  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
750  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
751 
+
752  // Arduino API callbacks
+
753  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
+
754  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
+
755  #define RADIOLIB_CB_ARGS_DIGITAL_READ (int, digitalRead, uint8_t pin)
+
756  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, unsigned int frequency, unsigned long duration)
+
757  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
+
758  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
+
759  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
+
760  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
+
761  #define RADIOLIB_CB_ARGS_DELAY (void, delay, uint32_t ms)
+
762  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
+
763  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
+
764  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
+
765  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
+
766  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
+
767  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
+
768  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
+
769  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
770 
+
771  // let's start off easy - no tone on this platform, that can happen
+
772  #define RADIOLIB_TONE_UNSUPPORTED
+
773 
+
774  // hmm, no yield either - weird on something like Raspberry PI, but sure, we can handle it
+
775  #define RADIOLIB_YIELD_UNSUPPORTED
+
776 
+
777  // aight, getting to the juicy stuff - PGM_P seems missing, that's the first time
+
778  #define PGM_P const char *
+
779 
+
780  // ... and for the grand finale, we have millis() and micros() DEFINED AS MACROS!
+
781  #if defined(millis)
+
782  #undef millis
+
783  inline unsigned long millis() { return((unsigned long)(STCV / 1000)); };
+
784  #endif
+
785 
+
786  #if defined(micros)
+
787  #undef micros
+
788  inline unsigned long micros() { return((unsigned long)(STCV)); };
+
789  #endif
+
790 
+
791  #else
+
792  // other Arduino platforms not covered by the above list - this may or may not work
+
793  #define RADIOLIB_PLATFORM "Unknown Arduino"
+
794  #define RADIOLIB_UNKNOWN_PLATFORM
+
795  #define RADIOLIB_PIN_TYPE uint8_t
+
796  #define RADIOLIB_PIN_MODE uint8_t
+
797  #define RADIOLIB_PIN_STATUS uint8_t
+
798  #define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
+
799  #define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
+
800  #define RADIOLIB_NC (0xFF)
+
801  #define RADIOLIB_DEFAULT_SPI SPI
+
802  #define RADIOLIB_DEFAULT_SPI_SETTINGS SPISettings(2000000, MSBFIRST, SPI_MODE0)
+
803  #define RADIOLIB_NONVOLATILE PROGMEM
+
804  #define RADIOLIB_NONVOLATILE_READ_BYTE(addr) pgm_read_byte(addr)
+
805  #define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
+
806 
+
807  // Arduino API callbacks
+
808  #define RADIOLIB_CB_ARGS_PIN_MODE (void, pinMode, uint8_t pin, uint8_t mode)
+
809  #define RADIOLIB_CB_ARGS_DIGITAL_WRITE (void, digitalWrite, uint8_t pin, uint8_t value)
+
810  #define RADIOLIB_CB_ARGS_DIGITAL_READ (int, digitalRead, uint8_t pin)
+
811  #define RADIOLIB_CB_ARGS_TONE (void, tone, uint8_t _pin, unsigned int frequency, unsigned long duration)
+
812  #define RADIOLIB_CB_ARGS_NO_TONE (void, noTone, uint8_t _pin)
+
813  #define RADIOLIB_CB_ARGS_ATTACH_INTERRUPT (void, attachInterrupt, uint8_t interruptNum, void (*userFunc)(void), int mode)
+
814  #define RADIOLIB_CB_ARGS_DETACH_INTERRUPT (void, detachInterrupt, uint8_t interruptNum)
+
815  #define RADIOLIB_CB_ARGS_YIELD (void, yield, void)
+
816  #define RADIOLIB_CB_ARGS_DELAY (void, delay, unsigned long ms)
+
817  #define RADIOLIB_CB_ARGS_DELAY_MICROSECONDS (void, delayMicroseconds, unsigned int us)
+
818  #define RADIOLIB_CB_ARGS_MILLIS (unsigned long, millis, void)
+
819  #define RADIOLIB_CB_ARGS_MICROS (unsigned long, micros, void)
+
820  #define RADIOLIB_CB_ARGS_SPI_BEGIN (void, SPIbegin, void)
+
821  #define RADIOLIB_CB_ARGS_SPI_BEGIN_TRANSACTION (void, SPIbeginTransaction, void)
+
822  #define RADIOLIB_CB_ARGS_SPI_TRANSFER (uint8_t, SPItransfer, uint8_t b)
+
823  #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
+
824  #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
+
825 
+
826  #endif
+
827 #endif
+
828 
+
829 #else
+
830  // generic non-Arduino platform
+
831  #define RADIOLIB_PLATFORM "Generic"
+
832 
+
833  // platform properties may be defined here, or somewhere else in the build system
+
834 
+
835 #endif
+
836 
+
837 /*
+
838  * Uncomment to enable debug output.
+
839  * Warning: Debug output will slow down the whole system significantly.
+
840  * Also, it will result in larger compiled binary.
+
841  * Levels: debug - only main info
+
842  * verbose - full transcript of all SPI communication
+
843  */
+
844 #if !defined(RADIOLIB_DEBUG)
+
845  //#define RADIOLIB_DEBUG
+
846 #endif
+
847 #if !defined(RADIOLIB_VERBOSE)
+
848  //#define RADIOLIB_VERBOSE
+
849 #endif
+
850 
+
851 // set which output port should be used for debug output
+
852 // may be Serial port (on Arduino) or file like stdout or stderr (on generic platforms)
+
853 #if !defined(RADIOLIB_DEBUG_PORT)
+
854  #define RADIOLIB_DEBUG_PORT Serial
+
855 #endif
+
856 
+
857 /*
+
858  * Uncomment to enable "paranoid" SPI mode
+
859  * Every write to an SPI register using SPI set function will be verified by a subsequent read operation.
+
860  * This improves reliablility, but slightly slows down communication.
+
861  * Note: Enabled by default.
862  */
-
863 #if !defined(RADIOLIB_STATIC_ONLY)
-
864  //#define RADIOLIB_STATIC_ONLY
+
863 #if !defined(RADIOLIB_SPI_PARANOID)
+
864  #define RADIOLIB_SPI_PARANOID
865 #endif
866 
-
867 // set the size of static arrays to use
-
868 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
-
869  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
-
870 #endif
-
871 
-
872 #if defined(RADIOLIB_DEBUG)
-
873  #if defined(RADIOLIB_BUILD_ARDUINO)
-
874  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
-
875  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
-
876  #else
-
877  #if !defined(RADIOLIB_DEBUG_PRINT)
-
878  #define RADIOLIB_DEBUG_PRINT(...) { frintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__); }
-
879  #endif
-
880  #if !defined(RADIOLIB_DEBUG_PRINTLN)
-
881  #define RADIOLIB_DEBUG_PRINTLN(...) { printf(RADIOLIB_DEBUG_PORT, __VA_ARGS__ "\n"); }
-
882  #endif
-
883  #endif
-
884 #else
-
885  #define RADIOLIB_DEBUG_PRINT(...) {}
-
886  #define RADIOLIB_DEBUG_PRINTLN(...) {}
-
887 #endif
-
888 
-
889 #if defined(RADIOLIB_VERBOSE)
-
890  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
-
891  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
-
892 #else
-
893  #define RADIOLIB_VERBOSE_PRINT(...) {}
-
894  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
+
867 /*
+
868  * Uncomment to enable parameter range checking
+
869  * RadioLib will check provided parameters (such as frequency) against limits determined by the device manufacturer.
+
870  * It is highly advised to keep this macro defined, removing it will allow invalid values to be set,
+
871  * possibly leading to bricked module and/or program crashing.
+
872  * Note: Enabled by default.
+
873  */
+
874 #if !defined(RADIOLIB_CHECK_PARAMS)
+
875  #define RADIOLIB_CHECK_PARAMS
+
876 #endif
+
877 
+
878 /*
+
879  * Uncomment to enable SX127x errata fix
+
880  * Warning: SX127x errata fix has been reported to cause issues with LoRa bandwidths lower than 62.5 kHz.
+
881  * It should only be enabled if you really are observing some errata-related issue.
+
882  * Note: Disabled by default.
+
883  */
+
884 #if !defined(RADIOLIB_FIX_ERRATA_SX127X)
+
885  //#define RADIOLIB_FIX_ERRATA_SX127X
+
886 #endif
+
887 
+
888 /*
+
889  * Uncomment to enable god mode - all methods and member variables in all classes will be made public, thus making them accessible from Arduino code.
+
890  * Warning: Come on, it's called GOD mode - obviously only use this if you know what you're doing.
+
891  * Failure to heed the above warning may result in bricked module.
+
892  */
+
893 #if !defined(RADIOLIB_GODMODE)
+
894  //#define RADIOLIB_GODMODE
895 #endif
896 
-
900 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
-
901 
-
902 /*
-
903  * Macros that create callback for the hardware abstraction layer.
-
904  *
-
905  * This is the most evil thing I have ever created. I am deeply sorry to anyone currently reading this text.
-
906  * Come one, come all and witness the horror:
-
907  * Variadics, forced expansions, inlined function, string concatenation, and it even messes up access specifiers.
+
897 /*
+
898  * Uncomment to enable low-level hardware access
+
899  * This will make some hardware methods like SPI get/set accessible from the user sketch - think of it as "god mode lite"
+
900  * Warning: RadioLib won't stop you from writing invalid stuff into your device, so it's quite easy to brick your module with this.
+
901  */
+
902 #if !defined(RADIOLIB_LOW_LEVEL)
+
903  //#define RADIOLIB_LOW_LEVEL
+
904 #endif
+
905 
+
906 /*
+
907  * Uncomment to enable pre-defined modules when using RadioShield.
908  */
-
909 #define RADIOLIB_FIRST(arg, ...) arg
-
910 #define RADIOLIB_REST(arg, ...) __VA_ARGS__
-
911 #define RADIOLIB_EXP(...) __VA_ARGS__
+
909 #if !defined(RADIOLIB_RADIOSHIELD)
+
910  //#define RADIOLIB_RADIOSHIELD
+
911 #endif
912 
-
913 #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;
-
914 #define RADIOLIB_GENERATE_CALLBACK_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, __VA_ARGS__)
-
915 #define RADIOLIB_GENERATE_CALLBACK(CB) RADIOLIB_GENERATE_CALLBACK_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
-
916 
-
917 #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;
-
918 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, __VA_ARGS__)
-
919 #define RADIOLIB_GENERATE_CALLBACK_SPI(CB) RADIOLIB_GENERATE_CALLBACK_SPI_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
913 /*
+
914  * Uncomment to enable static-only memory management: no dynamic allocation will be performed.
+
915  * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.
+
916  */
+
917 #if !defined(RADIOLIB_STATIC_ONLY)
+
918  //#define RADIOLIB_STATIC_ONLY
+
919 #endif
920 
-
924 #if defined(RADIOLIB_CHECK_PARAMS)
-
925  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
-
926 #else
-
927  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
-
928 #endif
-
929 
-
930 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
-
931  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
-
932 #else
-
933  #define RADIOLIB_ERRATA_SX127X(...) {}
-
934 #endif
-
935 
-
936 // version definitions
-
937 #define RADIOLIB_VERSION_MAJOR (0x05)
-
938 #define RADIOLIB_VERSION_MINOR (0x01)
-
939 #define RADIOLIB_VERSION_PATCH (0x00)
-
940 #define RADIOLIB_VERSION_EXTRA (0x00)
-
941 
-
942 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
-
943 
-
944 #endif
+
921 // set the size of static arrays to use
+
922 #if !defined(RADIOLIB_STATIC_ARRAY_SIZE)
+
923  #define RADIOLIB_STATIC_ARRAY_SIZE (256)
+
924 #endif
+
925 
+
926 #if defined(RADIOLIB_DEBUG)
+
927  #if defined(RADIOLIB_BUILD_ARDUINO)
+
928  #define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }
+
929  #define RADIOLIB_DEBUG_PRINTLN(...) { RADIOLIB_DEBUG_PORT.println(__VA_ARGS__); }
+
930  #else
+
931  #if !defined(RADIOLIB_DEBUG_PRINT)
+
932  #define RADIOLIB_DEBUG_PRINT(...) { frintf(RADIOLIB_DEBUG_PORT, __VA_ARGS__); }
+
933  #endif
+
934  #if !defined(RADIOLIB_DEBUG_PRINTLN)
+
935  #define RADIOLIB_DEBUG_PRINTLN(...) { printf(RADIOLIB_DEBUG_PORT, __VA_ARGS__ "\n"); }
+
936  #endif
+
937  #endif
+
938 #else
+
939  #define RADIOLIB_DEBUG_PRINT(...) {}
+
940  #define RADIOLIB_DEBUG_PRINTLN(...) {}
+
941 #endif
+
942 
+
943 #if defined(RADIOLIB_VERBOSE)
+
944  #define RADIOLIB_VERBOSE_PRINT(...) RADIOLIB_DEBUG_PRINT(__VA_ARGS__)
+
945  #define RADIOLIB_VERBOSE_PRINTLN(...) RADIOLIB_DEBUG_PRINTLN(__VA_ARGS__)
+
946 #else
+
947  #define RADIOLIB_VERBOSE_PRINT(...) {}
+
948  #define RADIOLIB_VERBOSE_PRINTLN(...) {}
+
949 #endif
+
950 
+
954 #define RADIOLIB_ASSERT(STATEVAR) { if((STATEVAR) != RADIOLIB_ERR_NONE) { return(STATEVAR); } }
+
955 
+
956 /*
+
957  * Macros that create callback for the hardware abstraction layer.
+
958  *
+
959  * This is the most evil thing I have ever created. I am deeply sorry to anyone currently reading this text.
+
960  * Come one, come all and witness the horror:
+
961  * Variadics, forced expansions, inlined function, string concatenation, and it even messes up access specifiers.
+
962  */
+
963 #define RADIOLIB_FIRST(arg, ...) arg
+
964 #define RADIOLIB_REST(arg, ...) __VA_ARGS__
+
965 #define RADIOLIB_EXP(...) __VA_ARGS__
+
966 
+
967 #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;
+
968 #define RADIOLIB_GENERATE_CALLBACK_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_RET_FUNC(RET, __VA_ARGS__)
+
969 #define RADIOLIB_GENERATE_CALLBACK(CB) RADIOLIB_GENERATE_CALLBACK_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
970 
+
971 #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;
+
972 #define RADIOLIB_GENERATE_CALLBACK_SPI_RET(RET, ...) RADIOLIB_GENERATE_CALLBACK_SPI_RET_FUNC(RET, __VA_ARGS__)
+
973 #define RADIOLIB_GENERATE_CALLBACK_SPI(CB) RADIOLIB_GENERATE_CALLBACK_SPI_RET(RADIOLIB_EXP(RADIOLIB_FIRST CB), RADIOLIB_EXP(RADIOLIB_REST CB))
+
974 
+
978 #if defined(RADIOLIB_CHECK_PARAMS)
+
979  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) { if(!(((VAR) >= (MIN)) && ((VAR) <= (MAX)))) { return(ERR); } }
+
980 #else
+
981  #define RADIOLIB_CHECK_RANGE(VAR, MIN, MAX, ERR) {}
+
982 #endif
+
983 
+
984 #if defined(RADIOLIB_FIX_ERRATA_SX127X)
+
985  #define RADIOLIB_ERRATA_SX127X(...) { errataFix(__VA_ARGS__); }
+
986 #else
+
987  #define RADIOLIB_ERRATA_SX127X(...) {}
+
988 #endif
+
989 
+
990 // version definitions
+
991 #define RADIOLIB_VERSION_MAJOR (0x05)
+
992 #define RADIOLIB_VERSION_MINOR (0x01)
+
993 #define RADIOLIB_VERSION_PATCH (0x00)
+
994 #define RADIOLIB_VERSION_EXTRA (0x00)
+
995 
+
996 #define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MINOR << 16) | (RADIOLIB_VERSION_PATCH << 8) | (RADIOLIB_VERSION_EXTRA))
+
997 
+
998 #endif