1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

27 Commits

Author SHA1 Message Date
Joshua DeWeese
45942f6821 sys/ztimer: fix re-scheduling of timers
If the timer at the head of a ztimer clock's timer list is re-scheduled
(ztimer_set() called on an already set timer) and the timer is no longer
at the head after being re-scheduled, clock-ops->set() is never called
from inside ztimer_set(), and the underlying timer is left with an ISR
scheduled to expire at the timer's old time. The intended behavior is
that the clock's lower level timer should always be set to expire at the
time of the clocks head timer.

This patch changes ztimer_set() to call _ztimer_update(), which sets the
lower level timer according to the current list of timers, rather than
setting the timer directly inside of ztimer_set().
2024-10-18 14:52:11 -04:00
chrysn
a26366371d sys/ztimer: Remove the deprecated ztimer_now64
This has been scheduled for removal after 2022.10, and its replacement
ztimer64_now has long been available.
2024-08-20 20:52:37 +02:00
Frederik Haxel
394cd0e3a8 sys: 64 bit compatibility
* priority_queue_t: Replaced `-1U` literal with PRIORITY_QUEUE_DATA_SIGNALING define
* architecture.h: Added 64-bit
* bloom.h: Fixed typedef for the hashfp_t function pointer
* vfs.h: Increased default vfs buffer sizes for 64 bit
* bytes.h: Check if socklen_t is already defined
* ztimer: Use PRIxPTR format specifier
2024-01-17 16:05:12 +01:00
Marian Buschsieweke
fd3ae2993f
sys/ztimer: work around bug in old LLVM
The sum of an `uint16_t` variable and a literal `1` should still be of
type `uin16_t`. And at least with LLVM 16 this seems to be the case,
but not with the LLVM version in our build container :/

So cast what should have been `uint16_t` anyway explicitly to `uint16_t`
to make that buggy version of LLVM happy.
2023-07-18 12:24:08 +02:00
Jue
2b53f35a28 ztimer: warn users when calling ztimer_now() on inactive clocks 2022-11-22 00:25:34 +01:00
Jue
4013dff1fd ztimer: acquire and release clock for running timers 2022-11-22 00:25:34 +01:00
Jue
a228ca7548 ztimer: introduce ztimer_acquire() and ztimer_release() 2022-11-22 00:25:34 +01:00
Jue
904dc0131f ztimer: don't interact with pm_layered if ztimer_ondemand is used 2022-11-02 22:36:54 +01:00
43988120f9
Merge pull request #17409 from kaspar030/ztimer_no_timer_fix
sys/ztimer: don't access non-existant timer
2021-12-17 23:27:04 +01:00
chrysn
991f74a62a sys/ztimer: ztimer_remove return its success
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2021-12-16 15:35:17 +01:00
b551bbf747 sys/ztimer: don't access non-existant timer 2021-12-15 15:51:59 +01:00
Francisco Molina
dd03d8c362 sys/ztimer: ztimer_set return the now value 2021-12-13 11:21:23 +01:00
Karl Fessel
eb11e463df sys/ztimer: make internal head update static 2021-11-18 13:45:49 +01:00
88b509e56d ztimer: correctly unset timer->next (fix ztimer_is_set())
ztimer's machinery depends on figuring out if a timer is currently set
or not. It does that using _is_set(), which is also exposed as
ztimer_is_set().
Now when a timer expired and got taken of the timer queue using
_now_next(), the `next` pointer wasn't unset. This caused _is_set() to
wrongly return `true` for that timer.
Internally in ztimer, this didn't cause breakage, just an unnecessary
iteration of the timer queue by _delete_timer_from_list().
But this also broke the public ztimer_is_set().

This commit fixes the issue by correctly NULLing the timer's `next`
pointer when the timer triggers.
2021-04-22 11:06:04 +02:00
Karl Fessel
951fa14d70 sys/ztimer: rename required_pm_mode to block_pm_mode 2021-04-06 16:57:53 +02:00
Martine Lenders
7e3846b6a4
ztimer: apply uncrustify patches 2021-02-02 22:21:15 +01:00
Hauke Petersen
f5de257d58 ztimer: expose ztimer_is_set() to public API 2021-01-18 17:50:50 +01:00
7fe0d5cba8 sys/ztimer: add missing inttypes.h includes 2020-11-26 13:43:13 +01:00
Bas Stottelaar
922e2ac1c9 sys/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:49:39 +01:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
44f8d82571
sys/ztimer: fix typo 'functinality' -> 'functionality' 2020-10-02 08:16:14 +02:00
e719eaf97c
Merge pull request #15003 from kaspar030/ztimer_now64_tick
ztimer/core: ensure half-period tick when ztimer_now64 is used
2020-09-23 14:14:52 +02:00
18852cf30c ztimer/core: ensure half-period tick when ztimer_now64 is used 2020-09-23 13:11:29 +02:00
2fbd85b798 sys/ztimer: allow compensation of ztimer_sleep() overhead 2020-09-09 12:50:51 +02:00
ba9afe98c3 sys/ztimer: uncrustify 2020-05-11 16:43:50 +02:00
Juergen Fitschen
73e22612e2 sys/ztimer: add power management for ztimer clocks 2020-04-29 10:55:10 +02:00
6dd79366bb sys: add ztimer subsystem
Co-authored-by: Joakim Nohlgård <joakim.nohlgard@eistec.se>
2020-03-04 12:44:02 +01:00