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

Refactor to separate out into components #2

Open
stianeklund opened this issue Jan 3, 2025 · 0 comments
Open

Refactor to separate out into components #2

stianeklund opened this issue Jan 3, 2025 · 0 comments

Comments

@stianeklund
Copy link
Owner

A lot of code can be moved and made into their own component, e.g:

project root/components/EthernetManager/

├── CMakeLists.txt
├── EthernetManager.cpp
└── include
    └── EthernetManager.h

Example CMakeLists.txt:

idf_component_register(
    SRCS "EthernetManager.cpp"
    INCLUDE_DIRS "include"
    REQUIRES
        driver
        esp_eth
        esp_netif
        esp_event
        nvs_flash
        lwip
)```

AFAIK no other changes are necessary aside from adding `REQUIRES` in the `CMakeLists.txt` in `main/`
e.g:

```idf_component_register(
    SRCS
        "main.cpp"
    INCLUDE_DIRS
        "."
    REQUIRES
        freertos
        esp_wifi
        nvs_flash
        esp_http_server
        driver
        esp_netif
        esp_timer
        json
        esp_eth
        i2c_manager
        kc868a16
        ethernet_manager
        pcf8574
        uart_manager
        wifi_manager
)```
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

1 participant