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

150 Commits

Author SHA1 Message Date
Bas Stottelaar
922e2ac1c9 sys/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:49:39 +01:00
Marian Buschsieweke
b48679e497
sys/ztimer: Use uint32_t for freq in periph_timer
Now that timer_init() of periph_timer uses uint32_t for the frequency, ztimer
should do the same.
2020-10-30 22:02:12 +01:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
Bas Stottelaar
ffb929d811 sys/*: remove unused assert.h include 2020-10-22 11:29:27 +02:00
44f8d82571
sys/ztimer: fix typo 'functinality' -> 'functionality' 2020-10-02 08:16:14 +02:00
2dab6c7b30
Merge pull request #15111 from maribu/xtimer-assert
sys/{x,z}timer: assert() successful initialization of periph_timer
2020-09-30 08:52:34 +02:00
aa6e64316c
Merge pull request #15053 from kaspar030/ztimer_periodic
sys/ztimer: add periodic timers API
2020-09-29 23:58:51 +02:00
548c4f02fc sys/ztimer: add ztimer_periodic 2020-09-29 23:04:39 +02:00
Marian Buschsieweke
a6dc9bdb2d
sys/ztimer: assert() successful initialized
Use an `assert()` to make sure that `periph_timer` was successfully initialized.
2020-09-29 11:52:26 +02:00
Juergen Fitschen
62fb4a2ade
Merge pull request #13661 from jue89/feature/evtimer_on_ztimer
sys/evtimer: introduce ZTIMER_MSEC as timer backend
2020-09-27 14:07:04 +02:00
Juergen Fitschen
c3a20f8fb8 sys/evtimer: introduce ZTIMER_MSEC as timer backend 2020-09-24 11:30:26 +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
Francisco
f3a5ee69e0
Merge pull request #14936 from kaspar030/ztimer_sleep_adjust
sys/ztimer: allow compensation of ztimer_sleep() overhead
2020-09-22 14:56:56 +02:00
0ee2a8fa5f sys/ztimer: fix auto_init doc 2020-09-14 18:05:09 +02:00
ff1ea0bfb1 ztimer: use uint32_t in ztimer_periodic_wakeup
This ensures compatibility with xtimer_periodic_wakeup() in case
ztimer_now64 is used.
2020-09-10 23:39:48 +02:00
2fbd85b798 sys/ztimer: allow compensation of ztimer_sleep() overhead 2020-09-09 12:50:51 +02:00
Marian Buschsieweke
3b6fa61829
sys: Cleanup access to internal variables
Replace direct accesses to sched_active_thread and sched_active_pid with
the helper functions thread_getpid() and thread_get_active(). This serves
two purposes:

1. It makes accidental writes to those variable from outside core less likely.
2. Casting off the volatile qualifier is now well contained to those two
   functions
2020-08-24 20:28:11 +02:00
f1d5e98c81
sys/ztimer: fix ztimer msec convert for 250kHz timers 2020-08-20 13:41:40 +02:00
fa2c8b01f4
sys/ztimer: fix missing include for periph_rtt submodule 2020-07-17 20:10:27 +02:00
Francisco
a665fcc542
Merge pull request #14123 from jue89/fix/ztimer_pseudomodules
ztimer: relocate PSEUDOMODULES definitions
2020-06-24 22:56:07 +02:00
56962f86fb
Merge pull request #14293 from kaspar030/fix_ztimer_frac_slowdown_max_value
ztimer: convert_frac: use self->scale_now for max_value
2020-06-16 19:30:54 +02:00
1ff609167e ztimer: convert_frac: use self->scale_now for max_value
When using convert_frac to slow down a timer, the extension machinery is
used to prevent converting values that would be larger than, after
conversion, 2**32. In order to calculate the maximum value, UINT32_MAX
is converted.

Previously, this was mistakenly converted by multiplying with the
fraction used to scale up a value. E.g., when using convert_frac to
slow down a 1us timer to provide a 1ms timer, UINT32_MAX was multiplied
by 1000. As the result is used % UINT32_MAX, this lead to a wrong value
close to UINT32_MAX, as ((UINT32_MAX * N) % UINT32_MAX = (UINT32_MAX - N - 1)).

This PR fixes the calculation so max_value is determined by multiplying
with the fraction used to scale down a value.
2020-06-16 12:24:11 +02:00
Francisco Molina
8d329942df
drivers/periph/rtt: introduce RTT_MIN_OFFSET 2020-06-11 09:30:25 +02:00
Juergen Fitschen
b098108c99 ztimer_xtimer_compat: move PSEUDOMODULES definition to Makefile.include 2020-05-23 16:50:24 +02:00
Juergen Fitschen
5a54c29f09 xtimer_on_ztimer: move PSEUDOMODULES definition to pseudomodules.inc.mk 2020-05-23 16:37:45 +02:00
bf35edf3c6
Merge pull request #14036 from jue89/fix/xtimer_on_ztimer
ztimer: pull in xtimer_on_ztimer only if ztimer_periph_timer is used
2020-05-19 12:26:12 +02:00
ba9afe98c3 sys/ztimer: uncrustify 2020-05-11 16:43:50 +02:00
Juergen Fitschen
bb0f7e5014 ztimer: pull in xtimer_on_ztimer only if ztimer_usec is used 2020-05-06 20:18:13 +02:00
Francisco Molina
95e2221003
sys/ztimer/auto_init: use default configuration header 2020-05-06 11:27:10 +02:00
Francisco Molina
a1f3a8d668
sys/ztimer: expose ZTIMER_MSEC/USEC_BASE
ztimer_clock are meant to be chained. At the end of the chaine
there is always a timer device object (periph_rtt/rtc/timer).

Since ZTIMER_MSEC and ZTIMER_USEC can be the scaled/shifted with
respect to the base periph_rtt/rtc/timer it makes sense to chain
other ZTIMER_XXX on top of the base rtc/timer/rtt in order to avoid
chained convertions.
2020-05-06 11:22:40 +02:00
benpicco
775b43fbd4
Merge pull request #13967 from fjmolinas/pr_ztimer_rtt_auto_init
sys/ztimer/auto_init: fix rtt auto_init
2020-05-05 14:34:48 +02:00
fc68d9c3a3 sys/ztimer: properly initialize intermediate extension callback 2020-05-04 17:25:27 +02:00
benpicco
f42b4b4d2f
Merge pull request #13722 from jue89/feature/ztimer_pm-layered
sys/ztimer: add power management for ztimer clocks
2020-05-01 14:12:45 +02:00
Juergen Fitschen
73e22612e2 sys/ztimer: add power management for ztimer clocks 2020-04-29 10:55:10 +02:00
Francisco Molina
da7e14dc66
sys/ztimer/auto_init: fix rtt auto_init 2020-04-28 09:11:44 +02:00
d8c129fc47 ztimer: periph_rtt: ensure RTT_MAX_VALUE is honored
Previously, ztimer would happily set an absolute RTT alarm value that exceeds
RTT's maximum value (though not a longer interval), as the `val` was
simply added to `rtt_get_counter()`.
This commit ensures that the target value wraps around RTT_MAX_VALUE.

Fixes #13920.
2020-04-23 16:19:25 +02:00
Francisco Molina
2331448644
Makefile: remove usage of SUBMODULES_NOFORCE
With #10970 only existing *.c files will be added to SRC when using
the SUBMODULES mechanism, so SUBMODULES_NOFORCE (used to filter out
non existing source files) is now redundant so remove the usage.
2020-04-15 12:11:44 +02:00
b45f4236de sys/ztimer: make ztimer_overhead() return signed value (int32_t) 2020-03-10 12:23:33 +01:00
c2f9700f5e
Merge pull request #13570 from kaspar030/ztimer_allow_adjust_config
sys/ztimer: allow "adjust" config for ztimer_usec, ztimer_msec
2020-03-10 11:58:21 +01:00
benpicco
d405cb7dd1
Merge pull request #13577 from kaspar030/fix_ztimer_rtt_logic
sys/ztimer: fix typo in rtt conversion selection
2020-03-09 19:11:07 +01:00
962679282e sys/ztimer: fix typo in rtt conversion selection 2020-03-06 14:49:56 +01:00
Juergen Fitschen
61334c3034 ztimer: fix RTT backend 2020-03-06 14:22:06 +01:00
2ad4ea67e9 sys/ztimer: allow configuring ZTIMER_[UM]SEC adjust value 2020-03-06 14:17:29 +01:00
c05d0bed66 sys/ztimer: make auto_init use LOG_DEBUG 2020-03-06 11:25:35 +01:00
dd218333c2 sys/ztimer: add xtimer_on_ztimer
This commit adds logic to make xtimer use ztimer_usec as backend
(instead of periph_timer). This allows ztimer_usec and xtimer to
coexist. It also allows xtimer to profit from eventually implemented
power mode blocking in ztimer's periph_timer backend.
2020-03-04 12:44:03 +01:00
21613b0aa6 sys/ztimer: adapt to DEFAULT_MODULE based auto_init scheme 2020-03-04 12:44:03 +01:00
8c1e577a06 sys/ztimer: move dependencies to sys/ztimer/Makefile.dep 2020-03-04 12:44:03 +01:00
eccb6e89ed sys/ztimer: add coccinelle script for xtimer -> ztimer conversion 2020-03-04 12:44:02 +01:00
6dd79366bb sys: add ztimer subsystem
Co-authored-by: Joakim Nohlgård <joakim.nohlgard@eistec.se>
2020-03-04 12:44:02 +01:00