Skip to content

Commit

Permalink
Load web data into SPIFFS
Browse files Browse the repository at this point in the history
  • Loading branch information
MG-5 committed Nov 26, 2022
1 parent 5b7df6b commit 2bd1775
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ idf_component_register(SRCS

INCLUDE_DIRS ".")

# Load web data into SPIFFS
set(WEB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../web-ui/esp-dfi-ignah-ui")
if(EXISTS ${WEB_SRC_DIR}/dist)
execute_process(COMMAND du -sh ${WEB_SRC_DIR}/dist OUTPUT_VARIABLE command_return)
MESSAGE( STATUS "size of dist folder: " ${command_return})
spiffs_create_partition_image(www ${WEB_SRC_DIR}/dist/esp-dfi-ignah-ui FLASH_IN_PROJECT)
else()
message(FATAL_ERROR "${WEB_SRC_DIR}/dist/esp-dfi-ignah-ui doesn't exit. Please run 'ng build' in ${WEB_SRC_DIR}")
endif()

# Unfortunately the pugixml library performs install and export.
# Override install() and export() to do nothing instead.
function(install)
Expand Down
5 changes: 3 additions & 2 deletions partitions.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
phy_init, data,phy, 0xf000, 0x1000,
factory, app,factory, 0x10000, 0x200000,
phy_init, data,phy, 0xf000, 0x1000,
factory, app,factory, 0x10000, 0x200000,
www, data, spiffs, , 1M,

0 comments on commit 2bd1775

Please sign in to comment.