You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a new I2C bus for ESP-ADF components that were introduced in #5230 by @jesserockz, in #6313.
I'm facing an issue I'm not able to solve by myself.
Problem 1
The ADF components from PR #5230 are declared under the /esphome/components/esp-peripherals/ and I need to include a file from this directory in my components folder /esphome/components/i2c/. I've tried to include the file directly (without the parent path) or relatively (with a ../esp-peripherals/ parent, but none seems to work.
Problem 2
Because, as we all know, naming things is hard, the file I'm trying to include is called i2c_bus.h (in components/esp-peripherals/driver/i2c/) while the components/i2c/ folder already contains a i2c_bus.h file. So if I include the file by just this base name doesn't work either since the one in the current folder is used.
Problem 3
In #5230, the PR changes a file esphome/core/defines.h to add a define USE_ESP_ADF. Yet this doesn't appear when building (it looks like that only the changes in the components folder is used when importing external components in YAML. Thus my PR for using the ADF components can't work unless that define is committed to the core defines file
To solve problem 1 and 2, currently, I'm thinking of copy and pasting the content of the cross component header in my own header file. However this is ugly since any change to the former header won't be reflected in the latter.
To solve problem 3, I'm re-defining it in the PR, but it's ugly and couldn't be merged in ESPHome that way since it would enable ADF unconditionally.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to implement a new I2C bus for ESP-ADF components that were introduced in #5230 by @jesserockz, in #6313.
I'm facing an issue I'm not able to solve by myself.
Problem 1
The ADF components from PR #5230 are declared under the
/esphome/components/esp-peripherals/
and I need to include a file from this directory in my components folder/esphome/components/i2c/
. I've tried to include the file directly (without the parent path) or relatively (with a../esp-peripherals/
parent, but none seems to work.Problem 2
Because, as we all know, naming things is hard, the file I'm trying to include is called
i2c_bus.h
(incomponents/esp-peripherals/driver/i2c/
) while thecomponents/i2c/
folder already contains ai2c_bus.h
file. So if I include the file by just this base name doesn't work either since the one in the current folder is used.Problem 3
In #5230, the PR changes a file
esphome/core/defines.h
to add a defineUSE_ESP_ADF
. Yet this doesn't appear when building (it looks like that only the changes in thecomponents
folder is used when importing external components in YAML. Thus my PR for using the ADF components can't work unless that define is committed to the core defines fileTo solve problem 1 and 2, currently, I'm thinking of copy and pasting the content of the cross component header in my own header file. However this is ugly since any change to the former header won't be reflected in the latter.
To solve problem 3, I'm re-defining it in the PR, but it's ugly and couldn't be merged in ESPHome that way since it would enable ADF unconditionally.
How to solve these issues cleanly?
Beta Was this translation helpful? Give feedback.
All reactions