Skip to content

Commit ffb3122

Browse files
committed
PR feedbacl
1 parent ba7fa1e commit ffb3122

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/components/i2c/WipperSnapper_I2C.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,16 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
375375
WS_DEBUG_PRINTLN("LTR390 Initialized Successfully!");
376376
} else if ((strcmp("ltr329", msgDeviceInitReq->i2c_device_name) == 0) ||
377377
(strcmp("ltr303", msgDeviceInitReq->i2c_device_name) == 0)) {
378-
_ltr329 = new WipperSnapper_I2C_Driver_LTR329(this->_i2c, i2cAddress);
378+
_ltr329 = new WipperSnapper_I2C_Driver_LTR329_LTR303(this->_i2c, i2cAddress);
379379
if (!_ltr329->begin()) {
380-
WS_DEBUG_PRINTLN("ERROR: Failed to initialize LTR329");
380+
WS_DEBUG_PRINTLN("ERROR: Failed to initialize LTR329/303");
381381
_busStatusResponse =
382382
wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL;
383383
return false;
384384
}
385385
_ltr329->configureDriver(msgDeviceInitReq);
386386
drivers.push_back(_ltr329);
387-
WS_DEBUG_PRINTLN("LTR329 Initialized Successfully!");
387+
WS_DEBUG_PRINTLN("LTR329/303 Initialized Successfully!");
388388
} else if (strcmp("sgp30", msgDeviceInitReq->i2c_device_name) == 0) {
389389
_sgp30 = new WipperSnapper_I2C_Driver_SGP30(this->_i2c, i2cAddress);
390390
if (!_sgp30->begin()) {

src/components/i2c/WipperSnapper_I2C.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "drivers/WipperSnapper_I2C_Driver_LPS22HB.h"
3838
#include "drivers/WipperSnapper_I2C_Driver_LPS25HB.h"
3939
#include "drivers/WipperSnapper_I2C_Driver_LPS3XHW.h"
40-
#include "drivers/WipperSnapper_I2C_Driver_LTR329.h"
40+
#include "drivers/WipperSnapper_I2C_Driver_LTR329_LTR303.h"
4141
#include "drivers/WipperSnapper_I2C_Driver_LTR390.h"
4242
#include "drivers/WipperSnapper_I2C_Driver_MAX17048.h"
4343
#include "drivers/WipperSnapper_I2C_Driver_MCP9808.h"
@@ -121,7 +121,7 @@ class WipperSnapper_Component_I2C {
121121
WipperSnapper_I2C_Driver_HTU21D *_htu21d = nullptr;
122122
WipperSnapper_I2C_Driver_HTU31D *_htu31d = nullptr;
123123
WipperSnapper_I2C_Driver_INA219 *_ina219 = nullptr;
124-
WipperSnapper_I2C_Driver_LTR329 *_ltr329 = nullptr;
124+
WipperSnapper_I2C_Driver_LTR329_LTR303 *_ltr329 = nullptr;
125125
WipperSnapper_I2C_Driver_LTR390 *_ltr390 = nullptr;
126126
WipperSnapper_I2C_Driver_MCP9808 *_mcp9808 = nullptr;
127127
WipperSnapper_I2C_Driver_MPL115A2 *_mpl115a2 = nullptr;

src/components/i2c/drivers/WipperSnapper_I2C_Driver_LTR329.h renamed to src/components/i2c/drivers/WipperSnapper_I2C_Driver_LTR329_LTR303.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
2-
* @file WipperSnapper_I2C_Driver_LTR329.h
2+
* @file WipperSnapper_I2C_Driver_LTR329_LTR303.h
33
*
4-
* Device driver for the LTR329 light sensor.
4+
* Device driver for the LTR329 + LTR303 (329+interrupt) light sensors.
55
*
66
* Adafruit invests time and resources providing this open source code,
77
* please support Adafruit and open-source hardware by purchasing
@@ -12,44 +12,44 @@
1212
* MIT license, all text here must be included in any redistribution.
1313
*
1414
*/
15-
#ifndef WipperSnapper_I2C_Driver_LTR329_H
16-
#define WipperSnapper_I2C_Driver_LTR329_H
15+
#ifndef WipperSnapper_I2C_Driver_LTR329_LTR303_H
16+
#define WipperSnapper_I2C_Driver_LTR329_LTR303_H
1717

1818
#include "WipperSnapper_I2C_Driver.h"
1919
#include <Adafruit_LTR329_LTR303.h>
2020

2121
/**************************************************************************/
2222
/*!
23-
@brief Class that provides a driver interface for a LTR329 sensor.
23+
@brief Class that provides a driver interface for a LTR329/303 sensor.
2424
*/
2525
/**************************************************************************/
26-
class WipperSnapper_I2C_Driver_LTR329 : public WipperSnapper_I2C_Driver {
26+
class WipperSnapper_I2C_Driver_LTR329_LTR303 : public WipperSnapper_I2C_Driver {
2727
public:
2828
/*******************************************************************************/
2929
/*!
30-
@brief Constructor for a LTR329 sensor.
30+
@brief Constructor for a LTR329/303 sensor.
3131
@param i2c
3232
The I2C interface.
3333
@param sensorAddress
3434
The 7-bit I2C address of the sensor.
3535
*/
3636
/*******************************************************************************/
37-
WipperSnapper_I2C_Driver_LTR329(TwoWire *i2c, uint16_t sensorAddress)
37+
WipperSnapper_I2C_Driver_LTR329_LTR303(TwoWire *i2c, uint16_t sensorAddress)
3838
: WipperSnapper_I2C_Driver(i2c, sensorAddress) {
3939
_i2c = i2c;
4040
_sensorAddress = sensorAddress;
4141
}
4242

4343
/*******************************************************************************/
4444
/*!
45-
@brief Destructor for an LTR329 sensor.
45+
@brief Destructor for an LTR329/303 sensor.
4646
*/
4747
/*******************************************************************************/
48-
~WipperSnapper_I2C_Driver_LTR329() { delete _LTR329; }
48+
~WipperSnapper_I2C_Driver_LTR329_LTR303() { delete _LTR329; }
4949

5050
/*******************************************************************************/
5151
/*!
52-
@brief Initializes the LTR329 sensor and begins I2C.
52+
@brief Initializes the LTR329/303 sensor and begins I2C.
5353
@returns True if initialized successfully, False otherwise.
5454
*/
5555
/*******************************************************************************/
@@ -72,7 +72,7 @@ class WipperSnapper_I2C_Driver_LTR329 : public WipperSnapper_I2C_Driver {
7272
/*!
7373
@brief Reads the LTR329's ambient light level ([Visible+IR] - IR-only)
7474
@param lightEvent
75-
Light sensor reading, in lux.
75+
Light sensor reading.
7676
@returns True if the sensor event was obtained successfully, False
7777
otherwise.
7878
*/
@@ -120,4 +120,4 @@ class WipperSnapper_I2C_Driver_LTR329 : public WipperSnapper_I2C_Driver {
120120
uint16_t _delayBetweenReads;
121121
};
122122

123-
#endif // WipperSnapper_I2C_Driver_LTR329
123+
#endif // WipperSnapper_I2C_Driver_LTR329_LTR303

0 commit comments

Comments
 (0)