From 8bbe1fd192b2ee20cf77fc52b61fc84ed1142146 Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 21 Mar 2024 18:13:37 +0100 Subject: [PATCH] allow more I2C devices at grove ports --- lib/hardware/GwM5Grove.in | 12 ++++---- webinstall/build.yaml | 63 +++++++++++++++++++++++++++++++++++++++ webinstall/cibuild.js | 24 ++++++++------- 3 files changed, 83 insertions(+), 16 deletions(-) diff --git a/lib/hardware/GwM5Grove.in b/lib/hardware/GwM5Grove.in index 35e3a74..6d9ce21 100644 --- a/lib/hardware/GwM5Grove.in +++ b/lib/hardware/GwM5Grove.in @@ -65,7 +65,7 @@ #GROVE //example: -DSHT3XG1_A : defines STH3Xn1 on grove A - x depends on the other devices -#ifdef SHT3XG1$GS$ +#ifdef GWSHT3XG1$GS$ #ifndef M5_GROOVEIIC$GS$ #define M5_GROOVEIIC$GS$ #endif @@ -74,7 +74,7 @@ #endif #GROVE -#ifdef SHT3XG2$GS$ +#ifdef GWSHT3XG2$GS$ #ifndef M5_GROOVEIIC$GS$ #define M5_GROOVEIIC$GS$ #endif @@ -83,7 +83,7 @@ #endif #GROVE -#ifdef QMP6988G1$GS$ +#ifdef GWQMP6988G1$GS$ #ifndef M5_GROOVEIIC$GS$ #define M5_GROOVEIIC$GS$ #endif @@ -92,7 +92,7 @@ #endif #GROVE -#ifdef QMP6988G2$GS$ +#ifdef GWQMP6988G2$GS$ #ifndef M5_GROOVEIIC$GS$ #define M5_GROOVEIIC$GS$ #endif @@ -101,7 +101,7 @@ #endif #GROVE -#ifdef BME280G1$GS$ +#ifdef GWBME280G1$GS$ #ifndef M5_GROOVEIIC$GS$ #define M5_GROOVEIIC$GS$ #endif @@ -110,7 +110,7 @@ #endif #GROVE -#ifdef BME280G2$GS$ +#ifdef GWBME280G2$GS$ #ifndef M5_GROOVEIIC$GS$ #define M5_GROOVEIIC$GS$ #endif diff --git a/webinstall/build.yaml b/webinstall/build.yaml index dc4e488..cdfde68 100644 --- a/webinstall/build.yaml +++ b/webinstall/build.yaml @@ -50,6 +50,69 @@ types: values: - value: M5_ENV3#grv# key: true + resource: qmp69881#grv#1,sht3x#grv#1 + - type: checkbox + label: SHT3X-1 + description: "SHT30 temperature and humidity sensor 0x44" + key: sht3xg1 + target: define + url: "https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/SHT3x_Datasheet_digital.pdf" + values: + - key: true + value: GWSHT3XG1#grv# + resource: sht3x#grv#1 + - type: checkbox + label: SHT3X-2 + description: "SHT30 temperature and humidity sensor 0x45" + key: sht3xg2 + target: define + url: "https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/SHT3x_Datasheet_digital.pdf" + values: + - key: true + value: GWSHT3XG2#grv# + resource: sht3x#grv#2 + - type: checkbox + label: QMP6988-1 + description: "QMP6988 pressure sensor addr 86" + key: qmp69881g1 + target: define + url: "https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/enviii/QMP6988%20Datasheet.pdf" + values: + - key: true + value: GWQMP6988G1#grv# + resource: qmp69881#grv#1 + - type: checkbox + label: QMP6988-2 + description: "QMP6988 pressure sensor addr 112" + key: qmp69882g2 + target: define + url: "https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/enviii/QMP6988%20Datasheet.pdf" + values: + - key: true + value: GWQMP6988G2#grv# + resource: qmp69881#grv#2 + - type: checkbox + label: BME280-1 + description: "BME280 temperature/humidity/pressure sensor 0x76" + key: bme2801g1 + target: define + url: "https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf" + values: + - key: true + value: GWBME280G1#grv# + resource: bme280#grv#1 + - type: checkbox + label: BME280-2 + description: "BME280 temperature/humidity/pressure sensor 0x77" + key: bme2802 + target: define + url: "https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf" + values: + - key: true + value: GWBME280G2#grv# + resource: bme280#grv#2 + + - &m5groovecan type: select key: m5groovecan#grv# diff --git a/webinstall/cibuild.js b/webinstall/cibuild.js index dc87fa6..c20660e 100644 --- a/webinstall/cibuild.js +++ b/webinstall/cibuild.js @@ -652,12 +652,15 @@ class PipelineInfo{ } if (round < 1) continue; if (struct.resource){ - let resList=currentResources[struct.resource]; - if (! resList){ - resList=[]; - currentResources[struct.resource]=resList; - } - resList.push(struct); + let splitted=struct.resource.split(","); + splitted.forEach((resource) => { + let resList = currentResources[resource]; + if (!resList) { + resList = []; + currentResources[resource] = resList; + } + resList.push(struct); + }); } if (target === 'define') { flags += " -D" + struct.value; @@ -680,11 +683,12 @@ class PipelineInfo{ for (let k in currentResources){ let ak=k.replace(/:.*/,''); let resList=currentResources[k]; - if (allowedResources[ak] !== undefined){ - if (resList.length > allowedResources[ak]){ - errors+=" more than "+allowedResources[ak]+" "+k+" device(s) used"; - } + let allowed=allowedResources[ak]; + if (allowed === undefined) allowed=1; + if (resList.length > allowed){ + errors+=" more than "+allowed+" "+k+" device(s) used"; } + } if (errors){ setValue('configError',errors);