凌云物联网实验室ISKBoard(IoT Starter Kits Board)开发板项目源码
guowenxue
2023-04-04 05e75df4906f9cfa3e0a8061ab072bb9c8e24248
Add system hangs when QC failed
1 files modified
25 ■■■■■ changed files
Production/ISKBoard_QCTester/Core/Src/main.c 25 ●●●●● patch | view | raw | blame | history
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);
@@ -222,6 +223,14 @@
}
/* USER CODE BEGIN 4 */
void system_hanges(void)
{
    while(1)
    {
        blink_led(LedRed, 500);
    }
}
int test_beep(void)
{
@@ -442,7 +451,10 @@
cleanup:
    if( rv )
    {
        oled_show("MikroBUS [FAIL]");
        system_hanges();
    }
    else
        oled_show("MikroBUS [OK]");
@@ -524,6 +536,9 @@
    snprintf(oledstr, sizeof(oledstr), "WiFi: %s", rv?"FAIL":"OK");
    oled_show(oledstr);
    if( rv )
        system_hanges();
    printf("\r\n");
    return 0;
}
@@ -555,6 +570,7 @@
    {
        printf("DS18B20 test              [FAIL]\r\n");
          oled_show("DS18B20: [FAIL]");
          system_hanges();
        return -1;
    }
@@ -578,6 +594,7 @@
    {
        printf("SHT20 test                [FAIL]\r\n");
          oled_show("SHT20: [FAIL]");
          system_hanges();
        return -1;
    }
@@ -603,7 +620,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 +650,7 @@
    {
        printf("USART3 RS232 test         [FAIL]\r\n");
        oled_show("RS232  [FAIL]");
        system_hanges();
    }
    else
    {
@@ -646,6 +669,7 @@
    {
        printf("CAN test                  [FAIL]\r\n");
        oled_show("CAN  [FAIL]");
        system_hanges();
    }
    else
    {
@@ -664,6 +688,7 @@
    {
        printf("RS485 test                [FAIL]\r\n");
        oled_show("RS485  [FAIL]");
        system_hanges();
    }
    else
    {