Skip to content

Commit 31b27a7

Browse files
author
Kirk Benell
authored
Merge pull request #2 from sparkfun/Resolve_ESP32_v2.0.5_warnings-as-errors
v1.0.1 - Resolve ESP32 v2.0.5 warnings-as-errors
2 parents f41504e + e2a2299 commit 31b27a7

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun Qwiic TMF882X Library
2-
version=1.0.0
2+
version=1.0.1
33
author=SparkFun Electronics <techsupport@sparkfun.com>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for the SparkFun Qwiic breakout boards for the AMS TMF882X sensor products.

src/qwiic_tmf882x.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ bool QwDevTMF882X::setI2CAddress(uint8_t address)
195195
{
196196
// Initialized? Is the address legal?
197197
if (!_isInitialized || address < 0x08 || address > 0x77)
198-
false;
198+
return false;
199199

200200
// is the address the same as already set?
201201
if (address == _i2cAddress)

src/qwiic_tmf882x.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -679,13 +679,24 @@ class QwDevTMF882X
679679
// Library initialized flag
680680
bool _isInitialized;
681681

682+
// Delay for the read sample loop
683+
uint16_t _sampleDelayMS;
684+
685+
// for managing message output levels
686+
uint8_t _outputSettings;
687+
bool _debug;
688+
689+
// Callback function pointers
690+
TMF882XMeasurementHandler _measurementHandlerCB;
691+
TMF882XHistogramHandler _histogramHandlerCB;
692+
TMF882XStatsHandler _statsHandlerCB;
693+
TMF882XErrorHandler _errorHandlerCB;
694+
TMF882XMessageHandler _messageHandlerCB;
695+
682696
// I2C things
683697
QwI2C *_i2cBus; // pointer to our i2c bus object
684698
uint8_t _i2cAddress; // address of the device
685699

686-
// Delay for the read sample loop
687-
uint16_t _sampleDelayMS;
688-
689700
// Structure/state for the underlying TOF SDK
690701
tmf882x_tof _TOF;
691702

@@ -698,16 +709,4 @@ class QwDevTMF882X
698709
// Flag to indicate to the system to stop measurements
699710
bool _stopMeasuring;
700711

701-
// Callbacks
702-
//
703-
// Callback function pointers
704-
TMF882XMeasurementHandler _measurementHandlerCB;
705-
TMF882XHistogramHandler _histogramHandlerCB;
706-
TMF882XStatsHandler _statsHandlerCB;
707-
TMF882XErrorHandler _errorHandlerCB;
708-
TMF882XMessageHandler _messageHandlerCB;
709-
710-
// for managing message output levels
711-
uint8_t _outputSettings;
712-
bool _debug;
713712
};

src/tmf882x_interface.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ int32_t tmf882x_open(struct tmf882x_tof * tof)
9696

9797
if (tof->state.ops->open &&
9898
tof->state.ops->open(&tof->state)) {
99-
tof_err(to_priv(&tof->state), "Error opening mode: %#x",
100-
mode);
99+
tof_err(to_priv(&tof->state), "Error opening mode");
101100
tmf882x_init(tof, to_priv(&tof->state));
102101
return -1;
103102
}

src/tmf882x_mode_app.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static uint8_t get_app_cmd_stat(struct tmf882x_mode_app *app)
417417
}
418418

419419
static int32_t check_cmd_status(struct tmf882x_mode_app *app,
420-
uint32_t retries)
420+
int32_t retries)
421421
{
422422
int32_t num_retries;
423423
uint8_t status;

src/tmf882x_mode_bl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int32_t tmf882x_mode_bl_read_status(struct tmf882x_mode_bl *bl,
128128
continue;
129129
}
130130
/* if we have reached here, the command has either succeeded or failed */
131-
if ( *rdata_size >= 0 ) {
131+
if ( *rdata_size > 0 ) {
132132
/* read in data part and csum */
133133
error = tof_i2c_read(priv(bl), BL_REG_CMD_STATUS,
134134
rbuf, BL_CALC_RSP_SIZE(*rdata_size));

0 commit comments

Comments
 (0)