sht4x support,, typo fix (#2843)

This commit is contained in:
Totoo 2025-10-28 03:14:11 +01:00 committed by GitHub
parent b739dd883c
commit 3b57672dda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 126 additions and 2 deletions

View file

@ -32,6 +32,7 @@
#include "i2cdev_ads1110.hpp"
#include "i2cdev_bh1750.hpp"
#include "i2cdev_ppmod.hpp"
#include "i2cdev_sht4x.hpp"
namespace i2cdev {
@ -73,6 +74,11 @@ bool I2CDevManager::found(uint8_t addr) {
if (!item.dev->init(addr)) item.dev = nullptr;
}
if (!item.dev && (addr == I2CDEV_SHT4X_ADDR_1 || addr == I2CDEV_SHT4X_ADDR_2)) {
item.dev = std::make_unique<I2cDev_SHT4x>();
if (!item.dev->init(addr)) item.dev = nullptr;
}
if (!item.dev && (addr == I2CDEV_MAX17055_ADDR_1)) {
item.dev = std::make_unique<I2cDev_MAX17055>();
if (!item.dev->init(addr)) item.dev = nullptr;