RTOS work threads
git-svn-id: svn://db.shs.com.ru/pip@687 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -19,6 +19,12 @@
|
||||
#include "pisysteminfo.h"
|
||||
#include "piincludes_p.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
# include "esp_heap_caps.h"
|
||||
# include "esp_system.h"
|
||||
# include "esp_spi_flash.h"
|
||||
#endif
|
||||
|
||||
|
||||
PISystemInfo::PISystemInfo() {
|
||||
processorsCount = 1;
|
||||
@@ -31,6 +37,36 @@ PISystemInfo * PISystemInfo::instance() {
|
||||
}
|
||||
|
||||
|
||||
ullong PISystemInfo::totalRAM() {
|
||||
#ifdef ESP_PLATFORM
|
||||
multi_heap_info_t heap_info;
|
||||
memset(&heap_info, 0, sizeof(multi_heap_info_t));
|
||||
heap_caps_get_info(&heap_info, MALLOC_CAP_8BIT);
|
||||
return heap_info.total_allocated_bytes + heap_info.total_free_bytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ullong PISystemInfo::freeRAM() {
|
||||
#ifdef ESP_PLATFORM
|
||||
multi_heap_info_t heap_info;
|
||||
memset(&heap_info, 0, sizeof(multi_heap_info_t));
|
||||
heap_caps_get_info(&heap_info, MALLOC_CAP_8BIT);
|
||||
return heap_info.total_free_bytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ullong PISystemInfo::usedRAM() {
|
||||
#ifdef ESP_PLATFORM
|
||||
multi_heap_info_t heap_info;
|
||||
memset(&heap_info, 0, sizeof(multi_heap_info_t));
|
||||
heap_caps_get_info(&heap_info, MALLOC_CAP_8BIT);
|
||||
return heap_info.total_allocated_bytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
PIStringList PISystemInfo::mountRoots() {
|
||||
PIStringList ret;
|
||||
#ifdef WINDOWS
|
||||
@@ -178,6 +214,14 @@ PIVector<PISystemInfo::MountInfo> PISystemInfo::mountInfo() {
|
||||
}
|
||||
# else
|
||||
# endif
|
||||
#endif
|
||||
#ifdef ESP_PLATFORM
|
||||
esp_chip_info_t chip_info;
|
||||
esp_chip_info(&chip_info);
|
||||
m.device = ((chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded SPI flash" : "external SPI flash");
|
||||
m.space_all = spi_flash_get_chip_size();
|
||||
m.mount_point = "/";
|
||||
ret << m;
|
||||
#endif
|
||||
cache = ret;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user