diff --git a/keywords.txt b/keywords.txt index 3b5fdf0f..150f81f9 100644 --- a/keywords.txt +++ b/keywords.txt @@ -176,6 +176,7 @@ shutdown KEYWORD2 ####################################### RADIOLIB_PIN_UNUSED LITERAL1 +RADIOLIB_VERSION LITERAL1 ERR_NONE LITERAL1 ERR_UNKNOWN LITERAL1 diff --git a/src/TypeDef.h b/src/TypeDef.h index 545359b7..90b417c5 100644 --- a/src/TypeDef.h +++ b/src/TypeDef.h @@ -1,11 +1,20 @@ #ifndef _RADIOLIB_TYPES_H #define _RADIOLIB_TYPES_H + #if ARDUINO >= 100 #include "Arduino.h" #else #error "Unsupported Arduino version (< 1.0.0)" #endif +// version definitions +#define RADIOLIB_VERSION_MAJOR (0x03) +#define RADIOLIB_VERSION_MINOR (0x00) +#define RADIOLIB_VERSION_PATCH (0x00) +#define RADIOLIB_VERSION_EXTRA (0x00) + +#define RADIOLIB_VERSION ((RADIOLIB_VERSION_MAJOR << 24) | (RADIOLIB_VERSION_MAJOR << 16) | (RADIOLIB_VERSION_MAJOR << 8) | (RADIOLIB_VERSION_EXTRA)) + /* * Uncomment to enable static-only memory management: no dynamic allocation will be performed. * Warning: Large static arrays will be created in some methods. It is not advised to send large packets in this mode.