check psram on self test (#628)

This commit is contained in:
WantClue 2025-01-08 08:37:29 +01:00 committed by GitHub
parent 8605bb4fb0
commit 1ea422f441
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -44,6 +44,7 @@ PRIV_REQUIRES
"esp_event"
"esp_http_server"
"esp_netif"
"esp_psram"
"esp_timer"
"esp_wifi"
"json"

View File

@ -21,6 +21,7 @@
#include "vcore.h"
#include "utils.h"
#include "TPS546.h"
#include "esp_psram.h"
#define GPIO_ASIC_ENABLE CONFIG_GPIO_ASIC_ENABLE
@ -288,6 +289,15 @@ esp_err_t test_init_peripherals(GlobalState * GLOBAL_STATE) {
return ESP_OK;
}
esp_err_t test_psram(GlobalState * GLOBAL_STATE){
if(!esp_psram_is_initialized()) {
ESP_LOGE(TAG, "No PSRAM available on ESP32!");
display_msg("PSRAM:FAIL", GLOBAL_STATE);
return ESP_FAIL;
}
return ESP_OK;
}
/**
* @brief Perform a self-test of the system.
*
@ -304,6 +314,12 @@ void self_test(void * pvParameters)
GLOBAL_STATE->SELF_TEST_MODULE.active = true;
//Run PSRAM test
if(test_psram(GLOBAL_STATE) != ESP_OK) {
ESP_LOGE(TAG, "NO PSRAM on device!");
tests_done(GLOBAL_STATE, TESTS_FAILED);
}
//Run display tests
if (test_display(GLOBAL_STATE) != ESP_OK) {
ESP_LOGE(TAG, "Display test failed!");