added a test #define to force tests to fail

This commit is contained in:
Skot 2025-01-17 18:41:55 -05:00
parent b81ad8561c
commit fcba427a79

View File

@ -28,6 +28,8 @@
#define TESTS_FAILED 0
#define TESTS_PASSED 1
//#define MEGA_FAIL_BUS 1 // Set to fail
/////Test Constants/////
//Test Fan Speed
#define FAN_SPEED_TARGET_MIN 1000 //RPM
@ -529,6 +531,11 @@ void self_test(void * pvParameters)
static void tests_done(GlobalState * GLOBAL_STATE, bool test_result)
{
#if MEGA_FAIL_BUS
test_result = TESTS_FAILED;
#endif
switch (GLOBAL_STATE->device_model) {
case DEVICE_MAX:
case DEVICE_ULTRA:
@ -541,7 +548,7 @@ static void tests_done(GlobalState * GLOBAL_STATE, bool test_result)
}
if (test_result == TESTS_FAILED) {
ESP_LOGI(TAG, "SELF TESTS FAIL -- Press RESET to continue");
ESP_LOGE(TAG, "-- SELFTEST FAIL --");
while (1) {
// Wait here forever until reset_self_test() gives the BootSemaphore
if (xSemaphoreTake(BootSemaphore, portMAX_DELAY) == pdTRUE) {
@ -553,7 +560,7 @@ static void tests_done(GlobalState * GLOBAL_STATE, bool test_result)
}
} else {
nvs_config_set_u16(NVS_CONFIG_SELF_TEST, 0);
ESP_LOGI(TAG, "Self Tests Passed!!!");
ESP_LOGI(TAG, "-- SELFTEST PASS!!! --");
}
}