| 175 | #endif |
| 176 | |
| 177 | void DynStorage::begin() { |
| 178 | if(fsMutex == NULL) { |
| 179 | fsMutex = xSemaphoreCreateMutex(); |
| 180 | } |
| 181 | |
| 182 | #ifndef SD_CARD_ONLY |
| 183 | initLittleFS(); |
| 184 | #endif |
| 185 | |
| 186 | #ifdef HAS_SDCARD |
| 187 | if(!sd_init_done) { |
| 188 | xSemaphoreTake(fsMutex, portMAX_DELAY); |
| 189 | initSDCard(); |
| 190 | xSemaphoreGive(fsMutex); |
| 191 | sd_init_done = true; |
| 192 | } |
| 193 | #ifndef SD_CARD_ONLY |
| 194 | copyIfNeeded("/index.html"); |
| 195 | copyIfNeeded("/fonts"); |
| 196 | copyIfNeeded("/www"); |
| 197 | copyIfNeeded("/tagtypes"); |
| 198 | copyIfNeeded("/AP_FW_Pack.bin"); |
| 199 | copyIfNeeded("/tag_md5_db.json"); |
| 200 | copyIfNeeded("/update_actions.json"); |
| 201 | copyIfNeeded("/content_template.json"); |
| 202 | #endif |
| 203 | #endif |
| 204 | |
| 205 | if (!contentFS->exists("/current")) { |
| 206 | contentFS->mkdir("/current"); |
| 207 | } |
| 208 | if (!contentFS->exists("/temp")) { |
| 209 | contentFS->mkdir("/temp"); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | void DynStorage::end() { |
| 214 | #ifdef HAS_SDCARD |
no test coverage detected