@@ -80,14 +80,15 @@ void test_simple_reset()
80
80
81
81
// Phase 1. -- run the test code.
82
82
// Init the watchdog and wait for a device reset.
83
- if (send_reset_notification (¤t_case, HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS ) == false ) {
83
+ if (send_reset_notification (¤t_case, 2 * HW_WATCHDOG_TIMEOUT ) == false ) {
84
84
TEST_ASSERT_MESSAGE (0 , " Dev-host communication error." );
85
85
return ;
86
86
}
87
87
TEST_ASSERT_TRUE (mbed_wdog_manager_start ());
88
88
// Block interrupts, including the one from the wdog_manager maintenance ticker.
89
89
core_util_critical_section_enter ();
90
- wait ((HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS) / 1000.0 ); // Device reset expected.
90
+ // Watchdog should fire before twice the timeout value.
91
+ wait ((2 * HW_WATCHDOG_TIMEOUT) / 1000.0 ); // Device reset expected.
91
92
92
93
// Watchdog reset should have occurred during wait() above;
93
94
@@ -120,17 +121,18 @@ void test_restart_reset()
120
121
// Block interrupts, including the one from the wdog_manager maintenance ticker.
121
122
core_util_critical_section_enter ();
122
123
// Check that stopping the Watchdog Manager prevents a device reset.
123
- wait ((HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS ) / 1000.0 );
124
+ wait ((2 * HW_WATCHDOG_TIMEOUT ) / 1000.0 );
124
125
core_util_critical_section_exit ();
125
126
126
- if (send_reset_notification (¤t_case, HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS ) == false ) {
127
+ if (send_reset_notification (¤t_case, 2 * HW_WATCHDOG_TIMEOUT ) == false ) {
127
128
TEST_ASSERT_MESSAGE (0 , " Dev-host communication error." );
128
129
return ;
129
130
}
130
131
TEST_ASSERT_TRUE (mbed_wdog_manager_start ());
131
132
// Block interrupts, including the one from the wdog_manager maintenance ticker.
132
133
core_util_critical_section_enter ();
133
- wait ((HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS) / 1000.0 ); // Device reset expected.
134
+ // Watchdog should fire before twice the timeout value.
135
+ wait ((2 * HW_WATCHDOG_TIMEOUT) / 1000.0 ); // Device reset expected.
134
136
135
137
// Watchdog reset should have occurred during wait() above;
136
138
@@ -149,16 +151,16 @@ void test_kick_reset()
149
151
150
152
// Phase 1. -- run the test code.
151
153
TEST_ASSERT_TRUE (mbed_wdog_manager_start ());
152
- wait ((HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS ) / 1000.0 ); // Device reset expected.
154
+ wait ((2 * HW_WATCHDOG_TIMEOUT ) / 1000.0 ); // Device reset expected.
153
155
154
- if (send_reset_notification (¤t_case, HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS ) == false ) {
156
+ if (send_reset_notification (¤t_case, 2 * HW_WATCHDOG_TIMEOUT ) == false ) {
155
157
TEST_ASSERT_MESSAGE (0 , " Dev-host communication error." );
156
158
return ;
157
159
}
158
160
// Block interrupts, including the one from the wdog_manager maintenance ticker.
159
161
core_util_critical_section_enter ();
160
-
161
- wait ((HW_WATCHDOG_TIMEOUT + TIMEOUT_DELTA_MS ) / 1000.0 ); // Device reset expected.
162
+ // Watchdog should fire before twice the timeout value.
163
+ wait ((2 * HW_WATCHDOG_TIMEOUT ) / 1000.0 ); // Device reset expected.
162
164
163
165
// Watchdog reset should have occurred during wait() above;
164
166
0 commit comments