1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 06:23:07 +01:00

handle multiple groves for iic

This commit is contained in:
andreas
2024-03-20 18:30:40 +01:00
parent e806971713
commit 99d7484afb
8 changed files with 98 additions and 71 deletions

View File

@@ -28,6 +28,7 @@ class SensorBase{
virtual void readConfig(GwConfigHandler *cfg)=0;
SensorBase(GwApi *api,const String &prfx):prefix(prfx){
}
using Creator=std::function<SensorBase<BUS> *(GwApi *api,const String &prfx)>;
virtual bool isActive(){return false;};
virtual bool initDevice(GwApi *api,BUS *wire){return false;};
virtual bool preinit(GwApi * api){return false;}
@@ -46,6 +47,7 @@ class SensorList : public std::vector<SensorBase<BUS>*>{
using std::vector<SensorBase<BUS>*>::vector;
};
#define CFG_GET(name,prefix) \
cfg->getValue(name, GwConfigDefinitions::prefix ## name)