Skip to content

v1.0.1 - Resolve ESP32 v2.0.5 warnings-as-errors #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
6 commits merged into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun Qwiic TMF882X Library
version=1.0.0
version=1.0.1
author=SparkFun Electronics <techsupport@sparkfun.com>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for the SparkFun Qwiic breakout boards for the AMS TMF882X sensor products.
Expand Down
2 changes: 1 addition & 1 deletion src/qwiic_tmf882x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ bool QwDevTMF882X::setI2CAddress(uint8_t address)
{
// Initialized? Is the address legal?
if (!_isInitialized || address < 0x08 || address > 0x77)
false;
return false;

// is the address the same as already set?
if (address == _i2cAddress)
Expand Down
29 changes: 14 additions & 15 deletions src/qwiic_tmf882x.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,13 +679,24 @@ class QwDevTMF882X
// Library initialized flag
bool _isInitialized;

// Delay for the read sample loop
uint16_t _sampleDelayMS;

// for managing message output levels
uint8_t _outputSettings;
bool _debug;

// Callback function pointers
TMF882XMeasurementHandler _measurementHandlerCB;
TMF882XHistogramHandler _histogramHandlerCB;
TMF882XStatsHandler _statsHandlerCB;
TMF882XErrorHandler _errorHandlerCB;
TMF882XMessageHandler _messageHandlerCB;

// I2C things
QwI2C *_i2cBus; // pointer to our i2c bus object
uint8_t _i2cAddress; // address of the device

// Delay for the read sample loop
uint16_t _sampleDelayMS;

// Structure/state for the underlying TOF SDK
tmf882x_tof _TOF;

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

// Callbacks
//
// Callback function pointers
TMF882XMeasurementHandler _measurementHandlerCB;
TMF882XHistogramHandler _histogramHandlerCB;
TMF882XStatsHandler _statsHandlerCB;
TMF882XErrorHandler _errorHandlerCB;
TMF882XMessageHandler _messageHandlerCB;

// for managing message output levels
uint8_t _outputSettings;
bool _debug;
};
3 changes: 1 addition & 2 deletions src/tmf882x_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ int32_t tmf882x_open(struct tmf882x_tof * tof)

if (tof->state.ops->open &&
tof->state.ops->open(&tof->state)) {
tof_err(to_priv(&tof->state), "Error opening mode: %#x",
mode);
tof_err(to_priv(&tof->state), "Error opening mode");
tmf882x_init(tof, to_priv(&tof->state));
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tmf882x_mode_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static uint8_t get_app_cmd_stat(struct tmf882x_mode_app *app)
}

static int32_t check_cmd_status(struct tmf882x_mode_app *app,
uint32_t retries)
int32_t retries)
{
int32_t num_retries;
uint8_t status;
Expand Down
2 changes: 1 addition & 1 deletion src/tmf882x_mode_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int32_t tmf882x_mode_bl_read_status(struct tmf882x_mode_bl *bl,
continue;
}
/* if we have reached here, the command has either succeeded or failed */
if ( *rdata_size >= 0 ) {
if ( *rdata_size > 0 ) {
/* read in data part and csum */
error = tof_i2c_read(priv(bl), BL_REG_CMD_STATUS,
rbuf, BL_CALC_RSP_SIZE(*rdata_size));
Expand Down