Commit c5d7fda
committed
OS/FreeRTOS: fix tick drift caused by wrong elapsed time calculation
When WFI wakes up but MTIME has not yet incremented, xModifiableIdleTime
equals XLastLoadValue. The previous '>' comparison would fall through to
the else branch and compute a bogus wraparound value (0xFFFFFFFF cycles),
causing vTaskStepTick() to advance the system tick by a huge amount.
Change '>' to '>=' so that equal values correctly yield zero elapsed time.
Signed-off-by: Huaqi Fang <578567190@qq.com>1 parent 906b2a5 commit c5d7fda
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
685 | 689 | | |
686 | 690 | | |
687 | 691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
0 commit comments