From 5937444d8c50fd85f603fae272f46bf10679fe28 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Tue, 04 Apr 2023 23:44:06 +0800 Subject: [PATCH] update test case sequence --- Production/ISKBoard_QCTester/Core/Src/main.c | 39 +++++++++++++++++++++++++++++++-------- 1 files changed, 31 insertions(+), 8 deletions(-) diff --git a/Production/ISKBoard_QCTester/Core/Src/main.c b/Production/ISKBoard_QCTester/Core/Src/main.c index 5662744..4d2e375 100644 --- a/Production/ISKBoard_QCTester/Core/Src/main.c +++ b/Production/ISKBoard_QCTester/Core/Src/main.c @@ -81,6 +81,7 @@ } +void system_hanges(void); int test_beep(void); int test_relay(void); int test_led(void); @@ -144,6 +145,9 @@ test_beep(); test_relay(); + test_spiflash(); + test_rtc(); + test_mikrobus(); /* USER CODE END 2 */ @@ -151,21 +155,16 @@ /* USER CODE BEGIN WHILE */ while (1) { - test_mikrobus(); - - test_spiflash(); - test_rtc(); - test_wifi(); - + test_led(); test_adc(); test_ds18b20(); test_sht20(); + test_wifi(); + test_usart3(); test_can(); test_rs485(); - - test_led(); /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ @@ -222,6 +221,14 @@ } /* USER CODE BEGIN 4 */ + +void system_hanges(void) +{ + while(1) + { + blink_led(LedRed, 500); + } +} int test_beep(void) { @@ -442,7 +449,10 @@ cleanup: if( rv ) + { oled_show("MikroBUS [FAIL]"); + system_hanges(); + } else oled_show("MikroBUS [OK]"); @@ -524,6 +534,9 @@ snprintf(oledstr, sizeof(oledstr), "WiFi: %s", rv?"FAIL":"OK"); oled_show(oledstr); + if( rv ) + system_hanges(); + printf("\r\n"); return 0; } @@ -555,6 +568,7 @@ { printf("DS18B20 test [FAIL]\r\n"); oled_show("DS18B20: [FAIL]"); + system_hanges(); return -1; } @@ -578,6 +592,7 @@ { printf("SHT20 test [FAIL]\r\n"); oled_show("SHT20: [FAIL]"); + system_hanges(); return -1; } @@ -603,7 +618,12 @@ rtc_time_t tm; if( get_rtc_time(&tm) < 0 ) + { + printf("RTC ISL1208 test [FAIL]\r\n"); + oled_show("RTC: [FAIL]"); + system_hanges(); return -1; + } printf("RTC: %04d-%02d-%02d %02d:%02d:%02d %s\r\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, weekday[tm.tm_wday]); @@ -628,6 +648,7 @@ { printf("USART3 RS232 test [FAIL]\r\n"); oled_show("RS232 [FAIL]"); + system_hanges(); } else { @@ -646,6 +667,7 @@ { printf("CAN test [FAIL]\r\n"); oled_show("CAN [FAIL]"); + system_hanges(); } else { @@ -664,6 +686,7 @@ { printf("RS485 test [FAIL]\r\n"); oled_show("RS485 [FAIL]"); + system_hanges(); } else { -- Gitblit v1.9.1