iperf example: add cmd to trace max heap usage
This commit is contained in:
parent
2b068f3ceb
commit
f7bb5c8f42
1 changed files with 15 additions and 0 deletions
|
@ -315,6 +315,13 @@ static int restart(int argc, char** argv)
|
||||||
esp_restart();
|
esp_restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int heap_size(int argc, char** argv)
|
||||||
|
{
|
||||||
|
uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
|
||||||
|
ESP_LOGI(TAG, "min heap size: %u", heap_size);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void register_wifi()
|
void register_wifi()
|
||||||
{
|
{
|
||||||
sta_args.ssid = arg_str1(NULL, NULL, "<ssid>", "SSID of AP");
|
sta_args.ssid = arg_str1(NULL, NULL, "<ssid>", "SSID of AP");
|
||||||
|
@ -378,4 +385,12 @@ void register_wifi()
|
||||||
};
|
};
|
||||||
|
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&iperf_cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&iperf_cmd) );
|
||||||
|
|
||||||
|
const esp_console_cmd_t heap_cmd = {
|
||||||
|
.command = "heap",
|
||||||
|
.help = "get min free heap size druing test",
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &heap_size,
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK( esp_console_cmd_register(&heap_cmd) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue