armchair_fw/main/CMakeLists.txt
jonny_ji7 a80502f95b Utilize SPIFFS for serving the app with web-server
With this commit the webserver of the controller can serve a folder (/react-app/build/), when the ip is accessed in a web-browser.

Currently the react app is successfully served and the armchair can be controlled when in HTTP mode and connected via AP.

- CMakeLists: Add command that creates and flashes the spiffs partition when running
  idf.py flash
- main.cpp: Add function to initialize spiffs
- http.cpp: uncomment handler for default URL (accesses spiffs)
- Add partitions.csv: needed for the creation of spiffs.bin during
  compilation
- Add sdkconfig: It was necessary to change the FLASH_SIZE from 2MB to
  4MB. To avoid having the same trouble on other devices the sdkconfig
  is now added to the repository
2022-06-17 22:33:29 +02:00

19 lines
376 B
CMake

idf_component_register(
SRCS
"main.cpp"
"motordrivers.cpp"
"motorctl.cpp"
"config.cpp"
"joystick.cpp"
"buzzer.cpp"
"control.cpp"
"button.cpp"
"fan.cpp"
"wifi.c"
"http.cpp"
INCLUDE_DIRS
"."
)
spiffs_create_partition_image(spiffs ../react-app/build FLASH_IN_PROJECT)