From a525d457ef42c4623bed3984de35f965b980b5cd Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 20 Oct 2024 16:20:49 +0100 Subject: [PATCH] Move RadioShield and CubeCell pin definition to RadioBoards --- keywords.txt | 1 - src/BuildOpt.h | 12 ------------ src/RadioLib.h | 42 ------------------------------------------ 3 files changed, 55 deletions(-) diff --git a/keywords.txt b/keywords.txt index c5fd90b5f..273fd409c 100644 --- a/keywords.txt +++ b/keywords.txt @@ -7,7 +7,6 @@ ####################################### RadioLib KEYWORD1 -RadioShield KEYWORD1 Module KEYWORD1 RadioLibHal KEYWORD1 ArduinoHal KEYWORD1 diff --git a/src/BuildOpt.h b/src/BuildOpt.h index 3df71d83c..96b6be32d 100644 --- a/src/BuildOpt.h +++ b/src/BuildOpt.h @@ -81,13 +81,6 @@ #define RADIOLIB_LOW_LEVEL (0) #endif -/* - * Enable pre-defined modules when using RadioShield, disabled by default. - */ -#if !defined(RADIOLIB_RADIOSHIELD) - #define RADIOLIB_RADIOSHIELD (0) -#endif - /* * Enable interrupt-based timing control * For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing @@ -142,7 +135,6 @@ * RADIOLIB_NONVOLATILE_READ_BYTE - function/macro to read variables saved in program storage (usually Flash). * RADIOLIB_TYPE_ALIAS - construct to create an alias for a type, usually vai the `using` keyword. * RADIOLIB_TONE_UNSUPPORTED - some platforms do not have tone()/noTone(), which is required for AFSK. - * RADIOLIB_BUILTIN_MODULE - some platforms have a builtin radio module on fixed pins, this macro is used to specify that pinout. * * In addition, some platforms may require RadioLib to disable specific drivers (such as ESP8266). * @@ -320,10 +312,6 @@ #define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE) #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes) - // provide an easy access to the on-board module - #include "board-config.h" - #define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY - // CubeCell doesn't seem to define nullptr, let's do something like that now #define nullptr NULL diff --git a/src/RadioLib.h b/src/RadioLib.h index 34b1d90e3..c416180bc 100644 --- a/src/RadioLib.h +++ b/src/RadioLib.h @@ -114,46 +114,4 @@ #include "utils/CRC.h" #include "utils/Cryptography.h" -// only create Radio class when using RadioShield -#if RADIOLIB_RADIOSHIELD - -// RadioShield pin definitions -#define RADIOSHIELD_CS_A 10 -#define RADIOSHIELD_IRQ_A 2 -#define RADIOSHIELD_RST_A 9 -#define RADIOSHIELD_GPIO_A 8 -#define RADIOSHIELD_CS_B 5 -#define RADIOSHIELD_IRQ_B 3 -#define RADIOSHIELD_RST_B 7 -#define RADIOSHIELD_GPIO_B 6 - -/*! - \class Radio - - \brief Library control object when using RadioShield. - Contains two pre-configured "modules", which correspond to the slots on shield. -*/ -class Radio { - public: - - Module* ModuleA; - Module* ModuleB; - - /*! - \brief Default constructor. Only used to set ModuleA and ModuleB configuration. - */ - Radio() { - ModuleA = new Module(RADIOSHIELD_CS_A, RADIOSHIELD_IRQ_A, RADIOSHIELD_RST_A, RADIOSHIELD_GPIO_A); - ModuleB = new Module(RADIOSHIELD_CS_B, RADIOSHIELD_IRQ_B, RADIOSHIELD_RST_B, RADIOSHIELD_GPIO_B); - } - -#if RADIOLIB_GODMODE - private: -#endif - -}; - -Radio RadioShield; -#endif - #endif