@@ -537,18 +537,29 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
537
537
_mcp9808->configureDriver (msgDeviceInitReq);
538
538
drivers.push_back (_mcp9808);
539
539
WS_DEBUG_PRINTLN (" MCP9808 Initialized Successfully!" );
540
- } else if (strcmp (" mlx90632d_med" , msgDeviceInitReq->i2c_device_name ) == 0 ||
541
- strcmp (" mlx90632d_ext" , msgDeviceInitReq->i2c_device_name ) == 0 ) {
542
- _mlx90632 = new WipperSnapper_I2C_Driver_MLX90632D (this ->_i2c , i2cAddress);
543
- if (!_mlx90632->begin ()) {
540
+ } else if (strcmp (" mlx90632d_med" , msgDeviceInitReq->i2c_device_name ) == 0 ) {
541
+ _mlx90632d = new WipperSnapper_I2C_Driver_MLX90632D (this ->_i2c , i2cAddress);
542
+ if (!_mlx90632d->begin ()) {
544
543
WS_DEBUG_PRINTLN (" ERROR: Failed to initialize MLX90632!" );
545
544
_busStatusResponse =
546
545
wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL;
547
546
return false ;
548
547
}
549
- _mlx90632 ->configureDriver (msgDeviceInitReq);
550
- drivers.push_back (_mlx90632 );
548
+ _mlx90632d ->configureDriver (msgDeviceInitReq);
549
+ drivers.push_back (_mlx90632d );
551
550
WS_DEBUG_PRINTLN (" MLX90632 Initialized Successfully!" );
551
+ } else if (strcmp (" mlx90632d_ext" , msgDeviceInitReq->i2c_device_name ) == 0 ) {
552
+ _mlx90632d_ext = new WipperSnapper_I2C_Driver_MLX90632D (this ->_i2c , i2cAddress);
553
+ // set extended range
554
+ if (!_mlx90632d_ext->begin () || !_mlx90632d_ext->ConfigureAndPrintSensorInfo (true )) {
555
+ WS_DEBUG_PRINTLN (" ERROR: Failed to initialize MLX90632D with extended range!" );
556
+ _busStatusResponse =
557
+ wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL;
558
+ return false ;
559
+ }
560
+ _mlx90632d_ext->configureDriver (msgDeviceInitReq);
561
+ drivers.push_back (_mlx90632d_ext);
562
+ WS_DEBUG_PRINTLN (" MLX90632D_EXT Initialized Successfully!" );
552
563
} else if (strcmp (" mpl115a2" , msgDeviceInitReq->i2c_device_name ) == 0 ) {
553
564
_mpl115a2 = new WipperSnapper_I2C_Driver_MPL115A2 (this ->_i2c , i2cAddress);
554
565
if (!_mpl115a2->begin ()) {
0 commit comments