Commit 5296c166 authored by TMRh20's avatar TMRh20

Merge branch 'Updates'

parents ded7e1bc 869a2c2f
...@@ -32,7 +32,7 @@ void RF24::csn(bool mode) ...@@ -32,7 +32,7 @@ void RF24::csn(bool mode)
// Return, CSN toggle complete // Return, CSN toggle complete
return; return;
#elif defined(ARDUINO) #elif defined(ARDUINO) && !defined (RF24_SPI_TRANSACTIONS)
// Minimum ideal SPI bus speed is 2x data rate // Minimum ideal SPI bus speed is 2x data rate
// If we assume 2Mbs data rate and 16Mhz clock, a // If we assume 2Mbs data rate and 16Mhz clock, a
// divider of 4 is the minimum we want. // divider of 4 is the minimum we want.
......
...@@ -116,8 +116,16 @@ ...@@ -116,8 +116,16 @@
// Arduino DUE is arm and does not include avr/pgmspace // Arduino DUE is arm and does not include avr/pgmspace
#if defined (ARDUINO_ARCH_ESP8266) #if defined (ARDUINO_ARCH_ESP8266)
#include <pgmspace.h> #include <pgmspace.h>
#define PRIPSTR "%s"
typedef uint16_t prog_uint16_t;
#define PSTR(x) (x)
#define printf_P printf #define printf_P printf
#define strlen_P strlen
#define PROGMEM
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(p) (*(p))
#define PRIPSTR "%s"
#elif defined(ARDUINO) && ! defined(__arm__) && !defined (__ARDUINO_X86__) #elif defined(ARDUINO) && ! defined(__arm__) && !defined (__ARDUINO_X86__)
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#define PRIPSTR "%S" #define PRIPSTR "%S"
......
...@@ -25,7 +25,7 @@ void SPI::begin(int busNo){ ...@@ -25,7 +25,7 @@ void SPI::begin(int busNo){
} }
//RPi: //RPi:
/* if(!busNo){ /*if(!busNo){
this->device = "/dev/spidev0.0";; this->device = "/dev/spidev0.0";;
}else{ }else{
this->device = "/dev/spidev0.1";; this->device = "/dev/spidev0.1";;
...@@ -111,6 +111,7 @@ uint8_t SPI::transfer(uint8_t tx_) ...@@ -111,6 +111,7 @@ uint8_t SPI::transfer(uint8_t tx_)
uint8_t tx[1] = {tx_}; uint8_t tx[1] = {tx_};
uint8_t rx[1]; uint8_t rx[1];
this->init();
struct spi_ioc_transfer tr = { struct spi_ioc_transfer tr = {
tr.tx_buf = (unsigned long)&tx[0], tr.tx_buf = (unsigned long)&tx[0],
tr.rx_buf = (unsigned long)&rx[0], tr.rx_buf = (unsigned long)&rx[0],
...@@ -151,7 +152,7 @@ void SPI::transfernb(char* tbuf, char* rbuf, uint32_t len) ...@@ -151,7 +152,7 @@ void SPI::transfernb(char* tbuf, char* rbuf, uint32_t len)
{ {
int ret; int ret;
this->init();
struct spi_ioc_transfer tr = { struct spi_ioc_transfer tr = {
tr.tx_buf = (unsigned long)tbuf, tr.tx_buf = (unsigned long)tbuf,
tr.rx_buf = (unsigned long)rbuf, tr.rx_buf = (unsigned long)rbuf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment