Commit cd3b0b3c authored by maniacbug's avatar maniacbug

Merge cleanups

parent 956b63a4
...@@ -616,9 +616,9 @@ void RF24::openReadingPipe(uint8_t child, uint64_t address) ...@@ -616,9 +616,9 @@ void RF24::openReadingPipe(uint8_t child, uint64_t address)
{ {
// For pipes 2-5, only write the LSB // For pipes 2-5, only write the LSB
if ( child < 2 ) if ( child < 2 )
write_register(child_pipe[child], reinterpret_cast<const uint8_t*>(&value), 5); write_register(child_pipe[child], reinterpret_cast<const uint8_t*>(&address), 5);
else else
write_register(child_pipe[child], reinterpret_cast<const uint8_t*>(&value), 1); write_register(child_pipe[child], reinterpret_cast<const uint8_t*>(&address), 1);
write_register(child_payload_size[child],payload_size); write_register(child_payload_size[child],payload_size);
...@@ -861,14 +861,16 @@ bool RF24::setDataRate(rf24_datarate_e speed) ...@@ -861,14 +861,16 @@ bool RF24::setDataRate(rf24_datarate_e speed)
write_register(RF_SETUP,setup); write_register(RF_SETUP,setup);
// Verify our result // Verify our result
setup = read_register(RF_SETUP) ; if ( read_register(RF_SETUP) == setup )
if( setup == setup )
{ {
return true ; result = true;
}
else
{
wide_band = false;
} }
wide_band = false ; return result;
return false ;
} }
/******************************************************************/ /******************************************************************/
......
...@@ -569,9 +569,21 @@ public: ...@@ -569,9 +569,21 @@ public:
/** /**
* Set the transmission data rate * Set the transmission data rate
* *
* @warning setting RF24_250KBPS will fail for non-P units
*
* @param speed RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps * @param speed RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps
* @return true if the change was successful
*/
bool setDataRate(rf24_datarate_e speed);
/**
* Fetches the transmission data rate
*
* @return Returns the hardware's currently configured datarate. The value
* is one of 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS, as defined in the
* rf24_datarate_e enum.
*/ */
void setDataRate(rf24_datarate_e speed); rf24_datarate_e getDataRate( void ) ;
/** /**
* Set the CRC length * Set the CRC length
......
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