Purge 'boolean' type, use 'bool' instead

This commit is contained in:
maniacbug 2011-07-10 08:22:30 -07:00
parent ccf32891f0
commit 42bf3e8cd2
9 changed files with 23 additions and 22 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.bak
*.o
.*.swp
*.orig

View File

@ -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
startWrite(buf,len);
@ -456,20 +456,20 @@ uint8_t RF24::getDynamicPayloadSize(void)
/******************************************************************/
boolean RF24::available(void)
bool RF24::available(void)
{
return available(NULL);
}
/******************************************************************/
boolean RF24::available(uint8_t* pipe_num)
bool RF24::available(uint8_t* pipe_num)
{
uint8_t status = get_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)
{
@ -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
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;
return result;
}
@ -667,7 +667,7 @@ void RF24::setAutoAck(bool enable)
/******************************************************************/
boolean RF24::testCarrier(void)
bool RF24::testCarrier(void)
{
return ( read_register(CD) & 1 );
}

14
RF24.h
View File

@ -24,7 +24,7 @@ private:
uint8_t ce_pin; /**< "Chip Enable" pin, activates the RX or TX role */
uint8_t csn_pin; /**< SPI Chip select */
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. */
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
* @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
*
* @return True if there is a payload available, false if none is
*/
boolean available(void);
bool available(void);
/**
* Read the payload
@ -269,7 +269,7 @@ public:
* @param len Maximum number of bytes to read into the buffer
* @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
@ -398,7 +398,7 @@ public:
* @param[out] pipe_num Which pipe has the payload available
* @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
@ -464,7 +464,7 @@ public:
*
* @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
@ -496,7 +496,7 @@ public:
*
* @return true if was carrier, false if not
*/
boolean testCarrier(void);
bool testCarrier(void);
/**
* Set the transmission data rate

View File

@ -229,7 +229,7 @@ void loop(void)
if ( radio.available() )
{
// Dump the payloads until we've gotten everything
boolean done = false;
bool done = false;
while (!done)
{
// Fetch the payload, and see if this was the last one.

View File

@ -192,7 +192,7 @@ void loop(void)
{
// Dump the payloads until we've gotten everything
unsigned long got_time;
boolean done = false;
bool done = false;
while (!done)
{
// Fetch the payload, and see if this was the last one.

View File

@ -209,7 +209,7 @@ void loop(void)
{
// Dump the payloads until we've gotten everything
uint8_t len;
boolean done = false;
bool done = false;
while (!done)
{
// Fetch the payload, and see if this was the last one.

View File

@ -160,7 +160,7 @@ void loop(void)
{
// Dump the payloads until we've gotten everything
static unsigned long got_time;
boolean done = false;
bool done = false;
while (!done)
{
// Fetch the payload, and see if this was the last one.

View File

@ -227,7 +227,7 @@ void loop(void)
{
// Dump the payloads until we've gotten everything
unsigned long got_time;
boolean done = false;
bool done = false;
while (!done)
{
// Fetch the payload, and see if this was the last one.

View File

@ -244,7 +244,7 @@ void loop(void)
{
// Dump the payloads until we've gotten everything
unsigned long got_time;
boolean done = false;
bool done = false;
while (!done)
{
// Fetch the payload, and see if this was the last one.