Add LittleFS for BL602 (#1159)

* Add little fs for bl602

* check for Lfs before creating file
This commit is contained in:
giedriuslt
2024-04-09 15:57:46 +03:00
committed by GitHub
parent 355b856f50
commit f1c1894235
9 changed files with 111 additions and 10 deletions

View File

@ -534,6 +534,14 @@ static int http_rest_post_lfs_file(http_request_t* request) {
// create if it does not exist
init_lfs(1);
if (!lfs_present()) {
request->responseCode = 400;
http_setup(request, httpMimeTypeText);
poststr(request, "LittleFS is not abailable");
poststr(request, NULL);
return 0;
}
fpath = os_malloc(strlen(request->url) - strlen("api/lfs/") + 1);
file = os_malloc(sizeof(lfs_file_t));
memset(file, 0, sizeof(lfs_file_t));