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

multiple groves for iic #1

This commit is contained in:
andreas
2024-03-20 17:43:19 +01:00
parent 1c80bf46b0
commit e806971713
5 changed files with 157 additions and 58 deletions

View File

@@ -3,6 +3,23 @@
#include "GwApi.h"
#include "N2kMessages.h"
#include "GwXdrTypeMappings.h"
#ifdef _IIC_GROOVE_LIST
class IICGrove{
public:
String base;
String grove;
String suffix;
IICGrove(const String &b,const String &g,const String &s):
base(b),grove(g),suffix(s){}
String item(const String &grove, const String &bus){
if (grove == this->grove) return base+bus+suffix;
return "";
}
};
static std::vector<IICGrove> iicGroveList;
#define GROOVE_IIC(base,grove,suffix) \
static GwInitializer<IICGrove> base ## grove ## suffix(iicGroveList,IICGrove(#base,#grove,#suffix));
#endif
#include "GwHardware.h"
#include "GwSensor.h"
#ifdef _GWIIC