@@ -537,18 +537,29 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
537537 _mcp9808->configureDriver (msgDeviceInitReq);
538538 drivers.push_back (_mcp9808);
539539 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 ()) {
544543 WS_DEBUG_PRINTLN (" ERROR: Failed to initialize MLX90632!" );
545544 _busStatusResponse =
546545 wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_DEVICE_INIT_FAIL;
547546 return false ;
548547 }
549- _mlx90632 ->configureDriver (msgDeviceInitReq);
550- drivers.push_back (_mlx90632 );
548+ _mlx90632d ->configureDriver (msgDeviceInitReq);
549+ drivers.push_back (_mlx90632d );
551550 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!" );
552563 } else if (strcmp (" mpl115a2" , msgDeviceInitReq->i2c_device_name ) == 0 ) {
553564 _mpl115a2 = new WipperSnapper_I2C_Driver_MPL115A2 (this ->_i2c , i2cAddress);
554565 if (!_mpl115a2->begin ()) {
0 commit comments