[nRF24] Reworked macro configuration system
This commit is contained in:
parent
509b8204f1
commit
63287ab6fd
2 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
#include "nRF24.h"
|
||||
#include <string.h>
|
||||
#if !defined(RADIOLIB_EXCLUDE_NRF24)
|
||||
#if !RADIOLIB_EXCLUDE_NRF24
|
||||
|
||||
nRF24::nRF24(Module* mod) : PhysicalLayer(RADIOLIB_NRF24_FREQUENCY_STEP_SIZE, RADIOLIB_NRF24_MAX_PACKET_LENGTH) {
|
||||
this->mod = mod;
|
||||
|
@ -617,7 +617,7 @@ void nRF24::SPIwriteTxPayload(uint8_t* data, uint8_t numBytes) {
|
|||
void nRF24::SPItransfer(uint8_t cmd, bool write, uint8_t* dataOut, uint8_t* dataIn, uint8_t numBytes) {
|
||||
// prepare the buffers
|
||||
size_t buffLen = 1 + numBytes;
|
||||
#if defined(RADIOLIB_STATIC_ONLY)
|
||||
#if RADIOLIB_STATIC_ONLY
|
||||
uint8_t buffOut[RADIOLIB_STATIC_ARRAY_SIZE];
|
||||
uint8_t buffIn[RADIOLIB_STATIC_ARRAY_SIZE];
|
||||
#else
|
||||
|
@ -648,7 +648,7 @@ void nRF24::SPItransfer(uint8_t cmd, bool write, uint8_t* dataOut, uint8_t* data
|
|||
memcpy(dataIn, &buffIn[1], numBytes);
|
||||
}
|
||||
|
||||
#if !defined(RADIOLIB_STATIC_ONLY)
|
||||
#if !RADIOLIB_STATIC_ONLY
|
||||
delete[] buffOut;
|
||||
delete[] buffIn;
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#if !defined(_RADIOLIB_NRF24_H) && !defined(RADIOLIB_EXCLUDE_NRF24)
|
||||
#if !defined(_RADIOLIB_NRF24_H) && !RADIOLIB_EXCLUDE_NRF24
|
||||
#define _RADIOLIB_NRF24_H
|
||||
|
||||
#include "../../Module.h"
|
||||
|
@ -467,7 +467,7 @@ class nRF24: public PhysicalLayer {
|
|||
*/
|
||||
int16_t setEncoding(uint8_t encoding) override;
|
||||
|
||||
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
|
||||
#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
|
||||
protected:
|
||||
#endif
|
||||
Module* mod;
|
||||
|
@ -476,7 +476,7 @@ class nRF24: public PhysicalLayer {
|
|||
void SPIwriteTxPayload(uint8_t* data, uint8_t numBytes);
|
||||
void SPItransfer(uint8_t cmd, bool write = false, uint8_t* dataOut = NULL, uint8_t* dataIn = NULL, uint8_t numBytes = 0);
|
||||
|
||||
#if !defined(RADIOLIB_GODMODE)
|
||||
#if !RADIOLIB_GODMODE
|
||||
protected:
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue