diff --git a/examples_RPi/gettingstarted.cpp b/examples_RPi/gettingstarted.cpp index 0aca94767..d25155e83 100644 --- a/examples_RPi/gettingstarted.cpp +++ b/examples_RPi/gettingstarted.cpp @@ -88,7 +88,7 @@ int main(int argc, char** argv){ bool role_ping_out = true, role_pong_back = false; bool role = role_pong_back; - printf("RF24/examples/GettingStarted/\n"); + cout << "RF24/examples/GettingStarted/\n"; // Setup and configure rf radio radio.begin(); diff --git a/examples_RPi/gettingstarted_call_response.cpp b/examples_RPi/gettingstarted_call_response.cpp index 23280ac5f..970151240 100644 --- a/examples_RPi/gettingstarted_call_response.cpp +++ b/examples_RPi/gettingstarted_call_response.cpp @@ -82,7 +82,7 @@ uint8_t counter = 1; // int main(int argc, char** argv){ - printf("RPi/RF24/examples/gettingstarted_call_response\n"); + cout << "RPi/RF24/examples/gettingstarted_call_response\n"; radio.begin(); radio.enableAckPayload(); // Allow optional ack payloads radio.enableDynamicPayloads(); diff --git a/examples_RPi/pingpair_dyn.cpp b/examples_RPi/pingpair_dyn.cpp index eba7ce75e..7cae0d355 100644 --- a/examples_RPi/pingpair_dyn.cpp +++ b/examples_RPi/pingpair_dyn.cpp @@ -79,7 +79,7 @@ int main(int argc, char** argv){ bool role = 0; // Print preamble: - printf("RF24/examples/pingpair_dyn/\n"); + cout << "RF24/examples/pingpair_dyn/\n"; // Setup and configure rf radio radio.begin(); diff --git a/examples_RPi/transfer.cpp b/examples_RPi/transfer.cpp index fcfba6fac..37a8209eb 100644 --- a/examples_RPi/transfer.cpp +++ b/examples_RPi/transfer.cpp @@ -79,7 +79,7 @@ int main(int argc, char** argv){ // Print preamble: - printf("RF24/examples/Transfer/\n"); + cout << "RF24/examples/Transfer/\n"; radio.begin(); // Setup and configure rf radio radio.setChannel(1); diff --git a/utility/BBB/RF24_arch_config.h b/utility/BBB/RF24_arch_config.h index b5815c399..cca9b6dd5 100644 --- a/utility/BBB/RF24_arch_config.h +++ b/utility/BBB/RF24_arch_config.h @@ -25,7 +25,7 @@ #define _BV(x) (1<<(x)) #define _SPI spi -#undef SERIAL_DEBUG +//#undef SERIAL_DEBUG #ifdef SERIAL_DEBUG #define IF_SERIAL_DEBUG(x) ({x;}) #else diff --git a/utility/BBB/spi.cpp b/utility/BBB/spi.cpp index da3ff76e1..cf233447a 100644 --- a/utility/BBB/spi.cpp +++ b/utility/BBB/spi.cpp @@ -47,8 +47,14 @@ void SPI::begin(int busNo){ void SPI::init() { int ret; + + if(this->fd > 0) { + close(this->fd); + } + this->fd = open(this->device.c_str(), O_RDWR); - if (this->fd < 0) + + if (this->fd < 0) { perror("can't open device"); abort();