Add component in ADF project

Sounder
Posts: 1
Joined: Sat Apr 15, 2023 3:52 pm

Add component in ADF project

Postby Sounder » Wed Dec 25, 2024 3:28 pm

Hi,
I am working on an audio project that uses a custom PCB with the ESP32-S3.
ADF v2.7 is installed. I used the example "play_mp3_control". Project does compile.

Now I need to add my own components (for example it is called esp-serial) to expand the functionality. Normally when working with the IDF that is not a big deal: add a components folder, git clone your component inside there including a cmakelist like the following and thats it.

Code: Select all

idf_component_register(
    SRCS 
        "esp-serial.c" 
    INCLUDE_DIRS 
        ""
    REQUIRES
        "driver"
)
All you have to do is add the component under requires in the cmakelist in main. That's it.
I naturally assumed that it would work in the same way with the ADF.
However, the structure of the cmakelist in main is completely different (idf_component_register is not used):

Code: Select all

set(COMPONENT_SRCS ./play_mp3_control_example.c)
set(COMPONENT_ADD_INCLUDEDIRS "")
set(COMPONENT_EMBED_TXTFILES music-16b-2c-44100hz.mp3)
register_component()
When I add the needed component at any point with:

Code: Select all

set(COMPONENT_REQUIRES esp-serial)
the project doesn't compile anymore.

So the question is, how do I add a component to the components folder and use it in the main file?

Kind regards
Markus

Who is online

Users browsing this forum: No registered users and 12 guests