[CC1101] Reworked macro configuration system

This commit is contained in:
jgromes 2023-11-27 19:39:24 +01:00
parent 1d77d8bd55
commit 0c436e5ed8
2 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
#include "CC1101.h" #include "CC1101.h"
#include <math.h> #include <math.h>
#if !defined(RADIOLIB_EXCLUDE_CC1101) #if !RADIOLIB_EXCLUDE_CC1101
CC1101::CC1101(Module* module) : PhysicalLayer(RADIOLIB_CC1101_FREQUENCY_STEP_SIZE, RADIOLIB_CC1101_MAX_PACKET_LENGTH) { CC1101::CC1101(Module* module) : PhysicalLayer(RADIOLIB_CC1101_FREQUENCY_STEP_SIZE, RADIOLIB_CC1101_MAX_PACKET_LENGTH) {
this->mod = module; this->mod = module;
@ -935,7 +935,7 @@ int16_t CC1101::getChipVersion() {
return(SPIgetRegValue(RADIOLIB_CC1101_REG_VERSION)); return(SPIgetRegValue(RADIOLIB_CC1101_REG_VERSION));
} }
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
void CC1101::setDirectAction(void (*func)(void)) { void CC1101::setDirectAction(void (*func)(void)) {
setGdo0Action(func, this->mod->hal->GpioInterruptRising); setGdo0Action(func, this->mod->hal->GpioInterruptRising);
} }

View file

@ -1,4 +1,4 @@
#if !defined(_RADIOLIB_CC1101_H) && !defined(RADIOLIB_EXCLUDE_CC1101) #if !defined(_RADIOLIB_CC1101_H) && !RADIOLIB_EXCLUDE_CC1101
#define _RADIOLIB_CC1101_H #define _RADIOLIB_CC1101_H
#include "../../TypeDef.h" #include "../../TypeDef.h"
@ -922,7 +922,7 @@ class CC1101: public PhysicalLayer {
*/ */
int16_t getChipVersion(); int16_t getChipVersion();
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
/*! /*!
\brief Set interrupt service routine function to call when data bit is receveid in direct mode. \brief Set interrupt service routine function to call when data bit is receveid in direct mode.
\param func Pointer to interrupt service routine. \param func Pointer to interrupt service routine.
@ -944,7 +944,7 @@ class CC1101: public PhysicalLayer {
*/ */
int16_t setDIOMapping(uint32_t pin, uint32_t value); int16_t setDIOMapping(uint32_t pin, uint32_t value);
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL) #if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
protected: protected:
#endif #endif
Module* mod; Module* mod;
@ -959,7 +959,7 @@ class CC1101: public PhysicalLayer {
void SPIsendCommand(uint8_t cmd); void SPIsendCommand(uint8_t cmd);
#if !defined(RADIOLIB_GODMODE) #if !RADIOLIB_GODMODE
protected: protected:
#endif #endif