mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-22 22:18:28 +00:00
ostest/wdog: Fix a synchronizing bug.
If we updated `callback_cnt` before the `triggered_tick` in the wdog timer callback, the `wdtest_rand` might failed randomly. This commit fixed the synchronizing bug by swapping the execution order of updating. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
parent
69bfda8736
commit
62fe1a3ac5
1 changed files with 4 additions and 4 deletions
|
|
@ -70,13 +70,13 @@ static void wdtest_callback(wdparm_t param)
|
|||
{
|
||||
FAR wdtest_param_t *wdtest_param = (FAR wdtest_param_t *)param;
|
||||
|
||||
/* Increment the callback count */
|
||||
|
||||
wdtest_param->callback_cnt += 1;
|
||||
|
||||
/* Record the system tick at which the callback was triggered */
|
||||
|
||||
wdtest_param->triggered_tick = clock_systime_ticks();
|
||||
|
||||
/* Increment the callback count */
|
||||
|
||||
wdtest_param->callback_cnt += 1;
|
||||
}
|
||||
|
||||
static void wdtest_checkdelay(sclock_t diff, sclock_t delay_tick)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue