Added error checking for NVS storage
Also added NVS storage diagnostic to 'm' command.
This commit is contained in:
parent
1e62a038f1
commit
4ab7503a72
|
|
@ -855,6 +855,9 @@ void Span::processSerialCommand(const char *c){
|
||||||
|
|
||||||
case 'm': {
|
case 'm': {
|
||||||
LOG0("Free Heap=%d bytes (low=%d)\n",heap_caps_get_free_size(MALLOC_CAP_DEFAULT),heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT));
|
LOG0("Free Heap=%d bytes (low=%d)\n",heap_caps_get_free_size(MALLOC_CAP_DEFAULT),heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT));
|
||||||
|
nvs_stats_t nvs_stats;
|
||||||
|
nvs_get_stats(NULL, &nvs_stats);
|
||||||
|
LOG0("NVS: %d of %d records used\n",nvs_stats.used_entries,nvs_stats.total_entries-126);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1611,6 +1614,11 @@ boolean Span::updateDatabase(boolean updateMDNS){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nvs_stats_t nvs_stats;
|
||||||
|
nvs_get_stats(NULL, &nvs_stats);
|
||||||
|
if(nvs_stats.free_entries<=130)
|
||||||
|
LOG0("\n*** WARNING: NVS is running low on space. Try erasing with 'E'. If that fails, increase size of NVS partition or reduce NVS usage.\n\n");
|
||||||
|
|
||||||
Loops.clear();
|
Loops.clear();
|
||||||
|
|
||||||
for(auto acc=Accessories.begin(); acc!=Accessories.end(); acc++){ // identify all services with over-ridden loop() methods
|
for(auto acc=Accessories.begin(); acc!=Accessories.end(); acc++){ // identify all services with over-ridden loop() methods
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue