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:
Connor Gibson
2025-06-01 15:15:56 -07:00
parent 3cf394b206
commit 55e189eda5
42 changed files with 262 additions and 277 deletions

View File

@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
@@ -34,11 +35,6 @@
#include <mcp23017.h>
#include <lcd.h>
#ifndef TRUE
# define TRUE (1==1)
# define FALSE (1==2)
#endif
// Defines for the Adafruit Pi LCD interface board
@@ -251,7 +247,7 @@ int main (int argc, char *argv[])
{
int colour ;
int cols = 16 ;
int waitForRelease = FALSE ;
int waitForRelease = false ;
struct tm *t ;
time_t tim ;
@@ -287,13 +283,13 @@ int main (int argc, char *argv[])
lcdPuts (lcdHandle, "User Char: ") ;
lcdPutchar (lcdHandle, 2) ;
lcdCursor (lcdHandle, TRUE) ;
lcdCursorBlink (lcdHandle, TRUE) ;
lcdCursor (lcdHandle, true) ;
lcdCursorBlink (lcdHandle, true) ;
waitForEnter () ;
lcdCursor (lcdHandle, FALSE) ;
lcdCursorBlink (lcdHandle, FALSE) ;
lcdCursor (lcdHandle, false) ;
lcdCursorBlink (lcdHandle, false) ;
speedTest () ;
@@ -320,7 +316,7 @@ int main (int argc, char *argv[])
if ((digitalRead (AF_UP) == LOW) || (digitalRead (AF_DOWN) == LOW))
continue ;
else
waitForRelease = FALSE ;
waitForRelease = false ;
}
if (digitalRead (AF_UP) == LOW) // Pushed
@@ -329,7 +325,7 @@ int main (int argc, char *argv[])
if (colour == 8)
colour = 0 ;
setBacklightColour (colour) ;
waitForRelease = TRUE ;
waitForRelease = true ;
}
if (digitalRead (AF_DOWN) == LOW) // Pushed
@@ -338,7 +334,7 @@ int main (int argc, char *argv[])
if (colour == -1)
colour = 7 ;
setBacklightColour (colour) ;
waitForRelease = TRUE ;
waitForRelease = true ;
}
}