Skip to content

Commit

Permalink
fix(littlefs): Allow LittleFS image generation on Windows + version bump
Browse files Browse the repository at this point in the history
Closes #12900
  • Loading branch information
adokitkat committed Nov 14, 2024
1 parent 6d7fd7a commit 94e5581
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
6 changes: 1 addition & 5 deletions examples/storage/littlefs/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ idf_component_register(SRCS "esp_littlefs_example.c"

# Note: you must have a partition named the first argument (here it's "littlefs")
# in your partition table csv file.
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
littlefs_create_partition_image(storage ../flash_data FLASH_IN_PROJECT)
else()
fail_at_build_time(littlefs "Windows does not support LittleFS partition generation")
endif()
littlefs_create_partition_image(storage ../flash_data FLASH_IN_PROJECT)
8 changes: 4 additions & 4 deletions examples/storage/littlefs/main/esp_littlefs_example.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* SPDX-FileCopyrightText: 2023 Brian Pugh
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
Expand Down Expand Up @@ -85,11 +85,11 @@ void app_main(void)
return;
}

char line[128];
char line[128] = {0};
fgets(line, sizeof(line), f);
fclose(f);
// strip newline
char*pos = strchr(line, '\n');
char* pos = strpbrk(line, "\r\n");
if (pos) {
*pos = '\0';
}
Expand All @@ -104,7 +104,7 @@ void app_main(void)
fgets(line, sizeof(line), f);
fclose(f);
// strip newline
pos = strchr(line, '\n');
pos = strpbrk(line, "\r\n");
if (pos) {
*pos = '\0';
}
Expand Down
2 changes: 1 addition & 1 deletion examples/storage/littlefs/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## IDF Component Manager Manifest File
dependencies:
joltwallet/littlefs: "~=1.14.4"
joltwallet/littlefs: "~=1.14.8"
2 changes: 1 addition & 1 deletion examples/storage/perf_benchmark/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## IDF Component Manager Manifest File
dependencies:
joltwallet/littlefs: "^1.14.1"
joltwallet/littlefs: "~=1.14.8"

0 comments on commit 94e5581

Please sign in to comment.