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

continue restructuring sensors, test env3

This commit is contained in:
andreas
2024-11-25 18:20:34 +01:00
parent 243c20c468
commit 7a7068e77c
9 changed files with 127 additions and 139 deletions

View File

@@ -102,31 +102,31 @@ SensorBase::Creator registerSHT3X(GwApi *api){
};
/**
* we do not dynamically compute the config names
* just to get compile time errors if something does not fit
* correctly
*/
#define CFGSHT3X(s,prefix,bus,baddr) \
CFG_SGET(s,tmNam,prefix); \
CFG_SGET(s,huNam,prefix); \
CFG_SGET(s,iid,prefix); \
CFG_SGET(s,tmAct,prefix); \
CFG_SGET(s,huAct,prefix); \
CFG_SGET(s,intv,prefix); \
CFG_SGET(s,huSrc,prefix); \
CFG_SGET(s,tmSrc,prefix); \
s->busId = bus; \
s->addr = baddr; \
s->ok = true; \
s->intv*=1000;
* we do not dynamically compute the config names
* just to get compile time errors if something does not fit
* correctly
*/
#define CFGSHT3X(s, prefix, bus, baddr) \
CFG_SGET(s, tmNam, prefix); \
CFG_SGET(s, huNam, prefix); \
CFG_SGET(s, iid, prefix); \
CFG_SGET(s, tmAct, prefix); \
CFG_SGET(s, huAct, prefix); \
CFG_SGET(s, intv, prefix); \
CFG_SGET(s, huSrc, prefix); \
CFG_SGET(s, tmSrc, prefix); \
s->busId = bus; \
s->addr = baddr; \
s->ok = true; \
s->intv *= 1000;
#define SCSHT3X(list, prefix, bus, addr) \
GWSENSORCONFIG(list, SHT3XConfig, prefix, [](SHT3XConfig *s, GwConfigHandler *cfg) { CFGSHT3X(s, prefix, bus, addr); });
#define SCSHT3X(prefix, bus, addr) \
GWSENSORDEF(configs, SHT3XConfig, CFGSHT3X, prefix, bus, addr)
SCSHT3X(configs, SHT3X11,1, 0x44);
SCSHT3X(configs, SHT3X12,1, 0x45);
SCSHT3X(configs, SHT3X21,2, 0x44);
SCSHT3X(configs, SHT3X22,2, 0x45);
SCSHT3X(SHT3X11, 1, 0x44);
SCSHT3X(SHT3X12, 1, 0x45);
SCSHT3X(SHT3X21, 2, 0x44);
SCSHT3X(SHT3X22, 2, 0x45);
#else
SensorBase::Creator registerSHT3X(GwApi *api){