mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #21003 from mguetschow/ztimer-overhead-adjust
sys/ztimer: mention ztimer_auto_adjust in relevant places
This commit is contained in:
commit
d3b28442ba
@ -178,13 +178,13 @@ PROGRAMMER ?= openocd
|
|||||||
|
|
||||||
## Timer Configurations {#board-timer-configurations}
|
## Timer Configurations {#board-timer-configurations}
|
||||||
|
|
||||||
When using high level timers, i.e. `ztimer` there is an overhead in calling
|
When using the high level timer `ztimer` there is an overhead in calling
|
||||||
for @ref ztimer_sleep and @ref ztimer_set functions. This offset can be
|
the @ref ztimer_sleep and @ref ztimer_set functions. This offset can be
|
||||||
compensated for. It can be measured by running `tests/sys/ztimer_overhead`
|
compensated for. It can be measured by running `tests/sys/ztimer_overhead`
|
||||||
on your board, i.e:
|
on your board, i.e:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ BOARD=my-new-board make -C tests/sys/ztimer_overhead
|
$ BOARD=my-new-board make -C tests/sys/ztimer_overhead flash term
|
||||||
main(): This is RIOT!
|
main(): This is RIOT!
|
||||||
ZTIMER_USEC auto_adjust params:
|
ZTIMER_USEC auto_adjust params:
|
||||||
ZTIMER_USEC->adjust_set = xx
|
ZTIMER_USEC->adjust_set = xx
|
||||||
@ -211,6 +211,10 @@ The last two lines can be added as defines to the new board `board.h`:
|
|||||||
/** @} */
|
/** @} */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Alternatively, the pseudomodule @ref pseudomodule_ztimer_auto_adjust can be used
|
||||||
|
in an application to enable automatic timer offset compensation at board startup.
|
||||||
|
This however incurs overhead both in the text segment and at bootup time.
|
||||||
|
|
||||||
## doc.txt {#board-doc}
|
## doc.txt {#board-doc}
|
||||||
|
|
||||||
Although not explicitly needed, if upstreamed and as a general good
|
Although not explicitly needed, if upstreamed and as a general good
|
||||||
|
@ -22,3 +22,7 @@ ZTIMER_USEC adjust params for dwm1001:
|
|||||||
CONFIG_ZTIMER_USEC_ADJUST_SET 6
|
CONFIG_ZTIMER_USEC_ADJUST_SET 6
|
||||||
CONFIG_ZTIMER_USEC_ADJUST_SLEEP 21
|
CONFIG_ZTIMER_USEC_ADJUST_SLEEP 21
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This test application also makes use of the `ztimer_auto_adjust` pseudomodule
|
||||||
|
and thereby allows for comparison of the offset values calculated during
|
||||||
|
auto-initialization and later during this test.
|
||||||
|
@ -67,9 +67,9 @@ int main(void)
|
|||||||
ZTIMER_USEC->adjust_sleep = 0;
|
ZTIMER_USEC->adjust_sleep = 0;
|
||||||
printf("ZTIMER_USEC auto_adjust params cleared\n");
|
printf("ZTIMER_USEC auto_adjust params cleared\n");
|
||||||
|
|
||||||
printf("zitmer_overhead_set...\n");
|
printf("ztimer_overhead_set...\n");
|
||||||
ZTIMER_USEC->adjust_set = _ztimer_usec_overhead(SAMPLES, BASE, ztimer_overhead_set);
|
ZTIMER_USEC->adjust_set = _ztimer_usec_overhead(SAMPLES, BASE, ztimer_overhead_set);
|
||||||
printf("zitmer_overhead_sleep...\n");
|
printf("ztimer_overhead_sleep...\n");
|
||||||
ZTIMER_USEC->adjust_sleep = _ztimer_usec_overhead(SAMPLES, BASE, ztimer_overhead_sleep);
|
ZTIMER_USEC->adjust_sleep = _ztimer_usec_overhead(SAMPLES, BASE, ztimer_overhead_sleep);
|
||||||
printf("ZTIMER_USEC adjust params for %s:\n", RIOT_BOARD);
|
printf("ZTIMER_USEC adjust params for %s:\n", RIOT_BOARD);
|
||||||
printf(" CONFIG_ZTIMER_USEC_ADJUST_SET %" PRIi16 "\n", ZTIMER_USEC->adjust_set);
|
printf(" CONFIG_ZTIMER_USEC_ADJUST_SET %" PRIi16 "\n", ZTIMER_USEC->adjust_set);
|
||||||
|
Loading…
Reference in New Issue
Block a user