[riot-commits] [RIOT-OS/RIOT] a270e4: xtimer: set now pointer correctly in _update_short...

Kaspar Schleiser noreply at github.com
Tue Apr 14 09:46:26 CEST 2020


  Branch: refs/heads/2020.04-branch
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: a270e4858ec757e2ae6eaa1dd36d6f82ac3e9ceb
      https://github.com/RIOT-OS/RIOT/commit/a270e4858ec757e2ae6eaa1dd36d6f82ac3e9ceb
  Author: Martine S. Lenders <mail at martine-lenders.eu>
  Date:   2020-04-11 (Sat, 11 Apr 2020)

  Changed paths:
    M sys/xtimer/xtimer_core.c

  Log Message:
  -----------
  xtimer: set now pointer correctly in _update_short_timers() loop

This fixes `xtimer` to use `xtimer_now64()` instead of `xtimer_now()`
for updating the `*now` variable during the iteration in
`_update_short_timers()` function. The same function is used to
initialize `*now` in `_timer_callback()` below.

While using `xtimer_now()` in this iteration step does not hinder the
proper execution of all timers in the short term timers (for those the
`xtimer` module only looks at the `start_time` member, not the
`long_start_time` member) at least for the current long term time window
(I did not test higher cases), it sets the `long_start_time` member to 0
for all timers following in the list of timers after this iteration
step. However, external modules that rely on this to be correct,
e.g. evtimer [1], fail their calculations when trying to compare to
the current value to `xtimer_now64()`.

[1] https://github.com/RIOT-OS/RIOT/blob/11f3d68/sys/evtimer/evtimer.c#L118-L121

Co-Authored-By: Cenk Gündoğan <mail+dev at gundogan.net>
(cherry picked from commit 212fe157863695dd526be6320ddc84ce6ff5d392)


  Commit: 95e6430bb846a871d42a2af7a50797a9cfe98871
      https://github.com/RIOT-OS/RIOT/commit/95e6430bb846a871d42a2af7a50797a9cfe98871
  Author: Martine S. Lenders <mail at martine-lenders.eu>
  Date:   2020-04-11 (Sat, 11 Apr 2020)

  Changed paths:
    A tests/xtimer_now32_overflow/Makefile
    A tests/xtimer_now32_overflow/README.md
    A tests/xtimer_now32_overflow/main.c
    A tests/xtimer_now32_overflow/tests/01-run.py

  Log Message:
  -----------
  tests/xtimer: add regression test for long_start_time update bug

Co-Authored-By: Julian Holzwarth <julian.holzwarth at fu-berlin.de>
(cherry picked from commit 4aa4a17071f79d2c2eb4c9e95db8474ed63abff6)


  Commit: 79c12a9c66937d2bea2d09b293ad6be82c6f87d1
      https://github.com/RIOT-OS/RIOT/commit/79c12a9c66937d2bea2d09b293ad6be82c6f87d1
  Author: Martine S. Lenders <mail at martine-lenders.eu>
  Date:   2020-04-11 (Sat, 11 Apr 2020)

  Changed paths:
    M sys/xtimer/xtimer_core.c

  Log Message:
  -----------
  xtimer_core: piggy-back style fixes

(cherry picked from commit 085c62ecdc9b4741566a1a708adea8e10b61d40d)


  Commit: ed180f2391c97e67a8fa0a58cb95204910884972
      https://github.com/RIOT-OS/RIOT/commit/ed180f2391c97e67a8fa0a58cb95204910884972
  Author: Kaspar Schleiser <kaspar at schleiser.de>
  Date:   2020-04-14 (Tue, 14 Apr 2020)

  Changed paths:
    M sys/xtimer/xtimer_core.c
    A tests/xtimer_now32_overflow/Makefile
    A tests/xtimer_now32_overflow/README.md
    A tests/xtimer_now32_overflow/main.c
    A tests/xtimer_now32_overflow/tests/01-run.py

  Log Message:
  -----------
  Merge pull request #13854 from miri64/backport/2020.04/xtimer/fix/now32-overflow

xtimer: set now pointer correctly in _update_short_timers() loop [backport 2020.04]


Compare: https://github.com/RIOT-OS/RIOT/compare/11f3d68887d3...ed180f2391c9


More information about the commits mailing list