move I2C pin defines inside ifndef block and reorder Bridge.begin() before Monitor.println()
This commit is contained in:
1 parent
bb23952c9a
commit
89173129d9
2 files changed
+8
-7
No files matched your search
@@ -33,6 +33,9 @@
|
||||
#define CULTIVAR_ENV_SCL 0
|
||||
#else
|
||||
#define CULTIVAR_SERIAL_PRINTF(fmt, ...) Serial.printf(fmt, ##__VA_ARGS__)
|
||||
// ── Default I2C pins (ESP32S3 dev board — override for production) ─────────
|
||||
#define CULTIVAR_ENV_SDA 42
|
||||
#define CULTIVAR_ENV_SCL 41
|
||||
#endif
|
||||
|
||||
#include <Arduino.h>
|
||||
@@ -41,9 +44,7 @@
|
||||
#include "vendor/bosch/bme69x.h"
|
||||
#include "vendor/bosch/bme69x_defs.h"
|
||||
|
||||
// ── Default I2C pins (ESP32S3 dev board — override for production) ─────────
|
||||
#define CULTIVAR_ENV_SDA 42
|
||||
#define CULTIVAR_ENV_SCL 41
|
||||
|
||||
|
||||
// ── I2C addresses ─────────────────────────────────────────────────────────
|
||||
#define CULTIVAR_ENV_BME690_ADDR BME69X_I2C_ADDR_LOW // 0x76
|
||||
|
||||
@@ -28,15 +28,15 @@ CultivarEnv env;
|
||||
static char jsonBuf[JSON_BUF_SIZE];
|
||||
|
||||
void setup() {
|
||||
Monitor.begin();
|
||||
|
||||
Monitor.println("\n[cultivar] ENV bridge starting...");
|
||||
|
||||
if (!Bridge.begin()) {
|
||||
Monitor.println("[ERROR] Bridge init failed");
|
||||
while (true) {}
|
||||
}
|
||||
|
||||
Monitor.println("\n[cultivar] ENV bridge starting...");
|
||||
|
||||
|
||||
|
||||
server.begin();
|
||||
Monitor.println("[cultivar] TCP bridge ready on :5678");
|
||||
|
||||
|
||||
Reference in new issue
Block a user