This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 19a63bdc194c57dd385e8a350cb9b064b20ce636
Author: yangguangcai <[email protected]>
AuthorDate: Wed Jul 5 16:20:37 2023 +0800

    watchdog: change usleep to up_udelay.
    
    change uleep to up_udelay prevent system into lower
    power mode and watchdog be pause stop count.
    
    Signed-off-by: yangguangcai <[email protected]>
---
 testing/drivertest/drivertest_watchdog.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/testing/drivertest/drivertest_watchdog.c 
b/testing/drivertest/drivertest_watchdog.c
index 85e94a606..8d6ded436 100644
--- a/testing/drivertest/drivertest_watchdog.c
+++ b/testing/drivertest/drivertest_watchdog.c
@@ -324,7 +324,7 @@ static void test_case_wdog_01(FAR void **state)
     {
       /* Sleep for the requested amount of time */
 
-      usleep(wdg_state->pingdelay * 1000);
+      up_udelay(wdg_state->pingdelay * 1000);
 
       /* Then ping */
 
@@ -334,9 +334,11 @@ static void test_case_wdog_01(FAR void **state)
 
   /* Then stop pinging */
 
-  /* Sleep for the requested amount of time */
+  /* Sleep for the requested amount of time, use up_udelay prevent system
+   * into low power mode and watchdog be pause cannot trigger restart.
+   */
 
-  usleep(2 * wdg_state->timeout * 1000);
+  up_udelay(2 * wdg_state->timeout * 1000);
 
   assert_true(false);
 }
@@ -456,9 +458,11 @@ static void test_case_wdog_04(FAR void **state)
 
   while (get_time_elaps(start_ms) < wdg_state->pingtime)
     {
-      /* Sleep for the requested amount of time */
+      /* Sleep for the requested amount of time, use up_udelay prevent
+       * system into low power mode and watchdog be pause stop count.
+       */
 
-      usleep(wdg_state->pingdelay * 1000);
+      up_udelay(wdg_state->pingdelay * 1000);
 
       if (wdg_state->test_getstatus)
         {

Reply via email to