mirror of
https://github.com/stakwork/sphinx-key.git
synced 2026-02-16 05:05:11 +01:00
finish esp restart on low memory
This commit is contained in:
@@ -226,6 +226,10 @@ fn restart_esp_if_memory_low() {
|
||||
unsafe {
|
||||
let size = esp_idf_sys::heap_caps_get_free_size(4);
|
||||
log::info!("Available DRAM: {}", size);
|
||||
if size < 65000 {
|
||||
log::info!("Restarting esp!");
|
||||
esp_idf_sys::esp_restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user