Purge 'boolean' type, use 'bool' instead
This commit is contained in:
parent
ccf32891f0
commit
42bf3e8cd2
|
@ -1,3 +1,4 @@
|
||||||
|
*.bak
|
||||||
*.o
|
*.o
|
||||||
.*.swp
|
.*.swp
|
||||||
*.orig
|
*.orig
|
||||||
|
|
18
RF24.cpp
18
RF24.cpp
|
@ -364,9 +364,9 @@ void RF24::powerDown(void)
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
boolean RF24::write( const void* buf, uint8_t len )
|
bool RF24::write( const void* buf, uint8_t len )
|
||||||
{
|
{
|
||||||
boolean result = false;
|
bool result = false;
|
||||||
|
|
||||||
// Begin the write
|
// Begin the write
|
||||||
startWrite(buf,len);
|
startWrite(buf,len);
|
||||||
|
@ -456,20 +456,20 @@ uint8_t RF24::getDynamicPayloadSize(void)
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
boolean RF24::available(void)
|
bool RF24::available(void)
|
||||||
{
|
{
|
||||||
return available(NULL);
|
return available(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
boolean RF24::available(uint8_t* pipe_num)
|
bool RF24::available(uint8_t* pipe_num)
|
||||||
{
|
{
|
||||||
uint8_t status = get_status();
|
uint8_t status = get_status();
|
||||||
|
|
||||||
// Too noisy, enable if you really want lots o data!! IF_SERIAL_DEBUG(print_status(status));
|
// Too noisy, enable if you really want lots o data!! IF_SERIAL_DEBUG(print_status(status));
|
||||||
|
|
||||||
boolean result = ( status & _BV(RX_DR) );
|
bool result = ( status & _BV(RX_DR) );
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
@ -496,7 +496,7 @@ boolean RF24::available(uint8_t* pipe_num)
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
boolean RF24::read( void* buf, uint8_t len )
|
bool RF24::read( void* buf, uint8_t len )
|
||||||
{
|
{
|
||||||
// Fetch the payload
|
// Fetch the payload
|
||||||
read_payload( buf, len );
|
read_payload( buf, len );
|
||||||
|
@ -648,9 +648,9 @@ void RF24::writeAckPayload(uint8_t pipe, const void* buf, uint8_t len)
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
boolean RF24::isAckPayloadAvailable(void)
|
bool RF24::isAckPayloadAvailable(void)
|
||||||
{
|
{
|
||||||
boolean result = ack_payload_available;
|
bool result = ack_payload_available;
|
||||||
ack_payload_available = false;
|
ack_payload_available = false;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -667,7 +667,7 @@ void RF24::setAutoAck(bool enable)
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
boolean RF24::testCarrier(void)
|
bool RF24::testCarrier(void)
|
||||||
{
|
{
|
||||||
return ( read_register(CD) & 1 );
|
return ( read_register(CD) & 1 );
|
||||||
}
|
}
|
||||||
|
|
14
RF24.h
14
RF24.h
|
@ -24,7 +24,7 @@ private:
|
||||||
uint8_t ce_pin; /**< "Chip Enable" pin, activates the RX or TX role */
|
uint8_t ce_pin; /**< "Chip Enable" pin, activates the RX or TX role */
|
||||||
uint8_t csn_pin; /**< SPI Chip select */
|
uint8_t csn_pin; /**< SPI Chip select */
|
||||||
uint8_t payload_size; /**< Fixed size of payloads */
|
uint8_t payload_size; /**< Fixed size of payloads */
|
||||||
boolean ack_payload_available; /**< Whether there is an ack payload waiting */
|
bool ack_payload_available; /**< Whether there is an ack payload waiting */
|
||||||
uint8_t ack_payload_length; /**< Dynamic size of pending ack payload. Note: not used. */
|
uint8_t ack_payload_length; /**< Dynamic size of pending ack payload. Note: not used. */
|
||||||
uint64_t pipe0_reading_address; /**< Last address set on pipe 0 for reading. */
|
uint64_t pipe0_reading_address; /**< Last address set on pipe 0 for reading. */
|
||||||
|
|
||||||
|
@ -246,14 +246,14 @@ public:
|
||||||
* @param len Number of bytes to be sent
|
* @param len Number of bytes to be sent
|
||||||
* @return True if the payload was delivered successfully false if not
|
* @return True if the payload was delivered successfully false if not
|
||||||
*/
|
*/
|
||||||
boolean write( const void* buf, uint8_t len );
|
bool write( const void* buf, uint8_t len );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether there are bytes available to be read
|
* Test whether there are bytes available to be read
|
||||||
*
|
*
|
||||||
* @return True if there is a payload available, false if none is
|
* @return True if there is a payload available, false if none is
|
||||||
*/
|
*/
|
||||||
boolean available(void);
|
bool available(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the payload
|
* Read the payload
|
||||||
|
@ -269,7 +269,7 @@ public:
|
||||||
* @param len Maximum number of bytes to read into the buffer
|
* @param len Maximum number of bytes to read into the buffer
|
||||||
* @return True if the payload was delivered successfully false if not
|
* @return True if the payload was delivered successfully false if not
|
||||||
*/
|
*/
|
||||||
boolean read( void* buf, uint8_t len );
|
bool read( void* buf, uint8_t len );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a pipe for writing
|
* Open a pipe for writing
|
||||||
|
@ -398,7 +398,7 @@ public:
|
||||||
* @param[out] pipe_num Which pipe has the payload available
|
* @param[out] pipe_num Which pipe has the payload available
|
||||||
* @return True if there is a payload available, false if none is
|
* @return True if there is a payload available, false if none is
|
||||||
*/
|
*/
|
||||||
boolean available(uint8_t* pipe_num);
|
bool available(uint8_t* pipe_num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Non-blocking write to the open writing pipe
|
* Non-blocking write to the open writing pipe
|
||||||
|
@ -464,7 +464,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return True if an ack payload is available.
|
* @return True if an ack payload is available.
|
||||||
*/
|
*/
|
||||||
boolean isAckPayloadAvailable(void);
|
bool isAckPayloadAvailable(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call this when you get an interrupt to find out why
|
* Call this when you get an interrupt to find out why
|
||||||
|
@ -496,7 +496,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return true if was carrier, false if not
|
* @return true if was carrier, false if not
|
||||||
*/
|
*/
|
||||||
boolean testCarrier(void);
|
bool testCarrier(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the transmission data rate
|
* Set the transmission data rate
|
||||||
|
|
|
@ -229,7 +229,7 @@ void loop(void)
|
||||||
if ( radio.available() )
|
if ( radio.available() )
|
||||||
{
|
{
|
||||||
// Dump the payloads until we've gotten everything
|
// Dump the payloads until we've gotten everything
|
||||||
boolean done = false;
|
bool done = false;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
// Fetch the payload, and see if this was the last one.
|
// Fetch the payload, and see if this was the last one.
|
||||||
|
|
|
@ -192,7 +192,7 @@ void loop(void)
|
||||||
{
|
{
|
||||||
// Dump the payloads until we've gotten everything
|
// Dump the payloads until we've gotten everything
|
||||||
unsigned long got_time;
|
unsigned long got_time;
|
||||||
boolean done = false;
|
bool done = false;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
// Fetch the payload, and see if this was the last one.
|
// Fetch the payload, and see if this was the last one.
|
||||||
|
|
|
@ -209,7 +209,7 @@ void loop(void)
|
||||||
{
|
{
|
||||||
// Dump the payloads until we've gotten everything
|
// Dump the payloads until we've gotten everything
|
||||||
uint8_t len;
|
uint8_t len;
|
||||||
boolean done = false;
|
bool done = false;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
// Fetch the payload, and see if this was the last one.
|
// Fetch the payload, and see if this was the last one.
|
||||||
|
|
|
@ -160,7 +160,7 @@ void loop(void)
|
||||||
{
|
{
|
||||||
// Dump the payloads until we've gotten everything
|
// Dump the payloads until we've gotten everything
|
||||||
static unsigned long got_time;
|
static unsigned long got_time;
|
||||||
boolean done = false;
|
bool done = false;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
// Fetch the payload, and see if this was the last one.
|
// Fetch the payload, and see if this was the last one.
|
||||||
|
|
|
@ -227,7 +227,7 @@ void loop(void)
|
||||||
{
|
{
|
||||||
// Dump the payloads until we've gotten everything
|
// Dump the payloads until we've gotten everything
|
||||||
unsigned long got_time;
|
unsigned long got_time;
|
||||||
boolean done = false;
|
bool done = false;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
// Fetch the payload, and see if this was the last one.
|
// Fetch the payload, and see if this was the last one.
|
||||||
|
|
|
@ -244,7 +244,7 @@ void loop(void)
|
||||||
{
|
{
|
||||||
// Dump the payloads until we've gotten everything
|
// Dump the payloads until we've gotten everything
|
||||||
unsigned long got_time;
|
unsigned long got_time;
|
||||||
boolean done = false;
|
bool done = false;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
// Fetch the payload, and see if this was the last one.
|
// Fetch the payload, and see if this was the last one.
|
||||||
|
|
Loading…
Reference in New Issue