Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__linux__ vs ESP_PLATFORM #2

Closed
hOff007 opened this issue Jul 2, 2024 · 5 comments
Closed

__linux__ vs ESP_PLATFORM #2

hOff007 opened this issue Jul 2, 2024 · 5 comments

Comments

@hOff007
Copy link

hOff007 commented Jul 2, 2024

Working with bmp180 lib on Debian 12, the include file is always bmp180/i2c_linux.h, even though the ESP_PLATFORM is defined.

@zorxx
Copy link
Owner

zorxx commented Jul 3, 2024

What version of esp-idf are you using? Does this happen when building the application in the example/esp-idf directory in this repository?

@hOff007
Copy link
Author

hOff007 commented Jul 3, 2024 via email

@zorxx
Copy link
Owner

zorxx commented Jul 4, 2024

I built the example/esp-idf application successfully under Debain 12 with esp-idf v5.2 using esp32 and esp32-s3 target devices, so I believe there is an issue with the way you are using the bmp180 component. To add bmp180 support to your application, add the component to your project with the idf.py add-component function. There are no additional #defines necessary. The esp-idf toolchain does not define linux, so it's getting defined somewhere else in your application.

@hOff007
Copy link
Author

hOff007 commented Jul 8, 2024 via email

@zorxx
Copy link
Owner

zorxx commented Jul 13, 2024

The xtensa esp32 gcc does not define linux. This can be verified by running the command:

echo | ~/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc -dM -E -

The output of this command is a list of all preprocessor definitions for the xtensa esp32 compiler. linux is not in the list. As long as you're building under an esp-idf environment, the host toolchain (in your case, debian) is not involved in compiling the bmp180 library and linux is not defined.

@zorxx zorxx closed this as completed Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants