Skip to content

Commit 581b3f6

Browse files
committed
Change boolean to bool
1 parent f4c81ef commit 581b3f6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/SparkFun_ACS37800_Arduino_Library.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ ACS37800ERR ACS37800::setI2Caddress(uint8_t newAddress)
227227
}
228228

229229
//Set the number of samples for RMS calculations. Bypass_N_Enable must be set/true for this to have effect.
230-
ACS37800ERR ACS37800::setNumberOfSamples(uint32_t numberOfSamples, boolean _eeprom)
230+
ACS37800ERR ACS37800::setNumberOfSamples(uint32_t numberOfSamples, bool _eeprom)
231231
{
232232
ACS37800ERR error = writeRegister(ACS37800_CUSTOMER_ACCESS_CODE, ACS37800_REGISTER_VOLATILE_2F); // Set the customer access code
233233

@@ -353,7 +353,7 @@ ACS37800ERR ACS37800::getNumberOfSamples(uint32_t *numberOfSamples)
353353
}
354354

355355
//Set/Clear the Bypass_N_Enable flag
356-
ACS37800ERR ACS37800::setBypassNenable(boolean bypass, boolean _eeprom)
356+
ACS37800ERR ACS37800::setBypassNenable(bool bypass, bool _eeprom)
357357
{
358358
ACS37800ERR error = writeRegister(ACS37800_CUSTOMER_ACCESS_CODE, ACS37800_REGISTER_VOLATILE_2F); // Set the customer access code
359359

@@ -466,7 +466,7 @@ ACS37800ERR ACS37800::setBypassNenable(boolean bypass, boolean _eeprom)
466466
}
467467

468468
//// Read and return the bypass_n_en flag from shadow memory
469-
ACS37800ERR ACS37800::getBypassNenable(boolean *bypass)
469+
ACS37800ERR ACS37800::getBypassNenable(bool *bypass)
470470
{
471471
ACS37800_REGISTER_0F_t store;
472472
ACS37800ERR error = readRegister(&store.data.all, ACS37800_REGISTER_SHADOW_1F); // Read register 1F
@@ -487,7 +487,7 @@ ACS37800ERR ACS37800::getBypassNenable(boolean *bypass)
487487
_debugPort->println(store.data.bits.bypass_n_en);
488488
}
489489

490-
*bypass = (boolean)store.data.bits.bypass_n_en; //Return bypass_n_en
490+
*bypass = (bool)store.data.bits.bypass_n_en; //Return bypass_n_en
491491

492492
return (error);
493493
}
@@ -844,7 +844,7 @@ ACS37800ERR ACS37800::readInstantaneous(float *vInst, float *iInst, float *pInst
844844
return (error); // Bail
845845
}
846846

847-
//Extract pinstant as signed int. Convert to VAR
847+
//Extract pinstant as signed int. Convert to W
848848
//pinstant as actually int16_t but is stored in a uint32_t as a 16-bit bitfield
849849
signedUnsigned.unSigned = pstore.data.bits.pinstant;
850850
float power = (float)signedUnsigned.Signed;

src/SparkFun_ACS37800_Arduino_Library.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class ACS37800
385385
//The user can also specify / override the ACS37800's current sensing range
386386
//ACS37800KMACTR-030B3-I2C is a 30.0 Amp part - Default - as used on the SparkFun Qwiic Power Meter
387387
//ACS37800KMACTR-090B3-I2C is a 90.0 Amp part
388-
boolean begin(uint8_t address = ACS37800_DEFAULT_I2C_ADDRESS, TwoWire &wirePort = Wire); //If user doesn't specify then Wire will be used
388+
bool begin(uint8_t address = ACS37800_DEFAULT_I2C_ADDRESS, TwoWire &wirePort = Wire); //If user doesn't specify then Wire will be used
389389

390390
//Debugging
391391
void enableDebugging(Stream &debugPort = Serial); //Turn on debug printing. If user doesn't specify then Serial will be used.
@@ -401,11 +401,11 @@ class ACS37800
401401
//Configurable Settings
402402
//By default, settings are written to the shadow registers only. Set _eeprom to true to write to EEPROM too.
403403
//Set/Get the number of samples for RMS calculations. Bypass_N_Enable must be set/true for this to have effect.
404-
ACS37800ERR setNumberOfSamples(uint32_t numberOfSamples, boolean _eeprom = false);
404+
ACS37800ERR setNumberOfSamples(uint32_t numberOfSamples, bool _eeprom = false);
405405
ACS37800ERR getNumberOfSamples(uint32_t *numberOfSamples); // Read and return the number of samples (from _shadow_ memory)
406406
//Set/Clear the Bypass_N_Enable flag
407-
ACS37800ERR setBypassNenable(boolean bypass, boolean _eeprom = false);
408-
ACS37800ERR getBypassNenable(boolean *bypass); // Read and return the bypass_n_en flag (from _shadow_ memory)
407+
ACS37800ERR setBypassNenable(bool bypass, bool _eeprom = false);
408+
ACS37800ERR getBypassNenable(bool *bypass); // Read and return the bypass_n_en flag (from _shadow_ memory)
409409
// Read and return the gain (from _shadow_ memory)
410410
ACS37800ERR getCurrentCoarseGain(float *currentCoarseGain);
411411

@@ -428,7 +428,7 @@ class ACS37800
428428

429429
//Debug
430430
Stream *_debugPort; //The stream to send debug messages to if enabled. Usually Serial.
431-
boolean _printDebug = false; //Flag to print debugging variables
431+
bool _printDebug = false; //Flag to print debugging variables
432432

433433
//ACS37800's I2C address
434434
uint8_t _ACS37800Address = ACS37800_DEFAULT_I2C_ADDRESS;

0 commit comments

Comments
 (0)