Switch to stdbool.h
- Add `#include <stdbool.h> to all files previously using the `TRUE`/`FALSE` macros - Replace all instances of `TRUE`/`FALSE` with `true`/`false`, respectively - Definitions of `TRUE`/`FALSE` macros retained in wiringPi.h for compatibility.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@@ -36,9 +37,6 @@
|
||||
#include <wiringPi.h>
|
||||
#include <wiringPiSPI.h>
|
||||
|
||||
#define TRUE (1==1)
|
||||
#define FALSE (!TRUE)
|
||||
|
||||
#define SPI_CHAN 0
|
||||
#define NUM_TIMES 100
|
||||
#define MAX_SIZE (1024*1024)
|
||||
@@ -78,7 +76,7 @@ int main (void)
|
||||
printf ("| MHz | Size | mS/Trans | TpS | Mb/Sec | Latency mS |\n") ;
|
||||
printf ("+-------+--------+----------+----------+-----------+------------+\n") ;
|
||||
|
||||
spiFail = FALSE ;
|
||||
spiFail = false ;
|
||||
spiSetup (speed * 1000000) ;
|
||||
for (size = 1 ; size <= MAX_SIZE ; size *= 2)
|
||||
{
|
||||
@@ -89,7 +87,7 @@ int main (void)
|
||||
if (wiringPiSPIDataRW (SPI_CHAN, myData, size) == -1)
|
||||
{
|
||||
printf ("SPI failure: %s\n", strerror (errno)) ;
|
||||
spiFail = TRUE ;
|
||||
spiFail = true ;
|
||||
break ;
|
||||
}
|
||||
end = millis () ;
|
||||
|
||||
Reference in New Issue
Block a user