1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-08 06:12:20 +01:00

[i2c] Expose internal i2c bus port number (#9136)

This commit is contained in:
Jesse Hills
2025-06-19 13:50:47 +12:00
committed by GitHub
parent 2e9ac8945d
commit d527398dae
6 changed files with 28 additions and 11 deletions

View File

@@ -1,11 +1,11 @@
#ifdef USE_ARDUINO
#include "i2c_bus_arduino.h"
#include <Arduino.h>
#include <cstring>
#include "esphome/core/application.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#include <Arduino.h>
#include <cstring>
namespace esphome {
namespace i2c {
@@ -23,6 +23,7 @@ void ArduinoI2CBus::setup() {
} else {
wire_ = new TwoWire(next_bus_num); // NOLINT(cppcoreguidelines-owning-memory)
}
this->port_ = next_bus_num;
next_bus_num++;
#elif defined(USE_ESP8266)
wire_ = new TwoWire(); // NOLINT(cppcoreguidelines-owning-memory)