mirror of https://github.com/ARMmbed/mbed-os.git
Test: update HAL reset_reason test
Update the watchdog timing requirements: 1. The watchdog should trigger at, or after the timeout value. 2. The watchdog should trigger before twice the timeout value.pull/10902/head
parent
b3d45c5eef
commit
68e536b368
|
@ -29,7 +29,6 @@
|
||||||
|
|
||||||
#define MSG_VALUE_WATCHDOG_STATUS "wdg_present"
|
#define MSG_VALUE_WATCHDOG_STATUS "wdg_present"
|
||||||
#define WDG_TIMEOUT_MS 50UL
|
#define WDG_TIMEOUT_MS 50UL
|
||||||
#define WDG_TIMEOUT_DELTA_MS 50UL
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define MSG_VALUE_WATCHDOG_STATUS "no_wdg"
|
#define MSG_VALUE_WATCHDOG_STATUS "no_wdg"
|
||||||
|
@ -115,7 +114,7 @@ static cmd_status_t handle_command(const char *key, const char *value)
|
||||||
TEST_ASSERT_MESSAGE(0, "hal_watchdog_init() error.");
|
TEST_ASSERT_MESSAGE(0, "hal_watchdog_init() error.");
|
||||||
return CMD_STATUS_ERROR;
|
return CMD_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
wait_ms(WDG_TIMEOUT_MS + WDG_TIMEOUT_DELTA_MS);
|
wait_ms(2 * WDG_TIMEOUT_MS); // Watchdog should fire before twice the timeout value.
|
||||||
TEST_ASSERT_MESSAGE(0, "Watchdog did not reset the device as expected.");
|
TEST_ASSERT_MESSAGE(0, "Watchdog did not reset the device as expected.");
|
||||||
return CMD_STATUS_ERROR;
|
return CMD_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue