diff --git a/library.properties b/library.properties index 03f9993..adf6297 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun Qwiic TMF882X Library -version=1.0.0 +version=1.0.1 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=Library for the SparkFun Qwiic breakout boards for the AMS TMF882X sensor products. diff --git a/src/qwiic_tmf882x.cpp b/src/qwiic_tmf882x.cpp index 0b5f192..76b4e06 100644 --- a/src/qwiic_tmf882x.cpp +++ b/src/qwiic_tmf882x.cpp @@ -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) diff --git a/src/qwiic_tmf882x.h b/src/qwiic_tmf882x.h index e1f61cc..ceb8796 100644 --- a/src/qwiic_tmf882x.h +++ b/src/qwiic_tmf882x.h @@ -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; @@ -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; }; diff --git a/src/tmf882x_interface.c b/src/tmf882x_interface.c index 1a905a8..4a9fe55 100644 --- a/src/tmf882x_interface.c +++ b/src/tmf882x_interface.c @@ -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; } diff --git a/src/tmf882x_mode_app.c b/src/tmf882x_mode_app.c index 6d70877..63fd035 100644 --- a/src/tmf882x_mode_app.c +++ b/src/tmf882x_mode_app.c @@ -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; diff --git a/src/tmf882x_mode_bl.c b/src/tmf882x_mode_bl.c index 2529a1b..9c6d90c 100644 --- a/src/tmf882x_mode_bl.c +++ b/src/tmf882x_mode_bl.c @@ -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));