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

@@ -7,17 +7,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <math.h>
#include <wiringPi.h>
#include <piFace.h>
#ifndef TRUE
# define TRUE (1==1)
# define FALSE (1==2)
#endif
#undef DEBUG
#define NUM_LEDS 8
@@ -244,7 +240,7 @@ void ledOnAction (void)
if (digitalRead (PIFACE) == LOW)
{
chargeCapacitor () ;
ledBargraph (vCap, TRUE) ;
ledBargraph (vCap, true) ;
}
}
@@ -264,7 +260,7 @@ void ledOffAction (void)
if (digitalRead (PIFACE) == LOW)
{
vCap = vCapLast = 0.0 ;
ledBargraph (vCap, FALSE) ;
ledBargraph (vCap, false) ;
// Wait until we release the button
@@ -300,7 +296,7 @@ int main (void)
// LED ON:
(void)ledBargraph (vCap, TRUE) ;
(void)ledBargraph (vCap, true) ;
then = millis () + ledOnTime ;
while (millis () < then)
{
@@ -323,7 +319,7 @@ int main (void)
// LED OFF:
(void)ledBargraph (vCap, FALSE) ;
(void)ledBargraph (vCap, false) ;
then = millis () + ledOffTime ;
while (millis () < then)
{