Skip to content

Commit

Permalink
Fix build issues against ESP32 (ESP-WROOM-32). (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-liu authored and Avamander committed Jan 22, 2018
1 parent d14ff47 commit 4accec5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ uint8_t RF24::read_register(uint8_t reg, uint8_t* buf, uint8_t len)

*ptx++ = ( R_REGISTER | ( REGISTER_MASK & reg ) );

while (len--){ *ptx++ = NOP; } // Dummy operation, just for reading
while (len--){ *ptx++ = RF24_NOP; } // Dummy operation, just for reading

_SPI.transfernb( (char *) spi_txbuff, (char *) spi_rxbuff, size);

Expand Down Expand Up @@ -132,7 +132,7 @@ uint8_t RF24::read_register(uint8_t reg)
uint8_t * prx = spi_rxbuff;
uint8_t * ptx = spi_txbuff;
*ptx++ = ( R_REGISTER | ( REGISTER_MASK & reg ) );
*ptx++ = NOP ; // Dummy operation, just for reading
*ptx++ = RF24_NOP ; // Dummy operation, just for reading

_SPI.transfernb( (char *) spi_txbuff, (char *) spi_rxbuff, 2);
result = *++prx; // result is 2nd byte of receive buffer
Expand Down Expand Up @@ -282,7 +282,7 @@ uint8_t RF24::read_payload(void* buf, uint8_t data_len)

*ptx++ = R_RX_PAYLOAD;
while(--size)
*ptx++ = NOP;
*ptx++ = RF24_NOP;

size = data_len + blank_len + 1; // Size has been lost during while, re affect

Expand Down Expand Up @@ -345,7 +345,7 @@ uint8_t RF24::spiTrans(uint8_t cmd){

uint8_t RF24::get_status(void)
{
return spiTrans(NOP);
return spiTrans(RF24_NOP);
}

/****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion RF24_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
#include <pgmspace.h>
#define PRIPSTR "%s"

#elif defined(ARDUINO) && ! defined(__arm__) && !defined (__ARDUINO_X86__) || defined(XMEGA)
#elif defined(ARDUINO) && !defined(ESP_PLATFORM) && ! defined(__arm__) && !defined (__ARDUINO_X86__) || defined(XMEGA)
#include <avr/pgmspace.h>
#define PRIPSTR "%S"
#else
Expand Down
2 changes: 1 addition & 1 deletion examples/rf24_ATTiny/timingSearch3pin/timingSearch3pin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ version 2 as published by the Free Software Foundation.
#define FLUSH_TX 0xE1
#define FLUSH_RX 0xE2
#define REUSE_TX_PL 0xE3
#define NOP 0xFF
#define RF24_NOP 0xFF

/* Non-P omissions */
#define LNA_HCURR 0
Expand Down
2 changes: 1 addition & 1 deletion nRF24L01.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
#define FLUSH_TX 0xE1
#define FLUSH_RX 0xE2
#define REUSE_TX_PL 0xE3
#define NOP 0xFF
#define RF24_NOP 0xFF

/* Non-P omissions */
#define LNA_HCURR 0
Expand Down

0 comments on commit 4accec5

Please sign in to comment.