Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/ztimer: fix RTT backend #13574

Merged
merged 1 commit into from
Mar 6, 2020
Merged

sys/ztimer: fix RTT backend #13574

merged 1 commit into from
Mar 6, 2020

Conversation

jue89
Copy link
Contributor

@jue89 jue89 commented Mar 6, 2020

Contribution description

First of all: congratulations on merging ztimer!

While trying tests/ztimer_msg with TIMER_MSEC I noticed that ztimer ignores the present periph_rtt and converted the pertiph_timer down to milliseconds.

This patch fixes this behavior.

Testing procedure

Enable debugging in sys/ztimer/auto_init.c. Compile tests/ztimer_msg with USEMODULE="ztimer_msec ztimer_periph_rtt" make BOARD=board_with_rtt flash term.

Boot output with this patch:

020-03-06 14:05:11,078 # ztimer_init(): ZTIMER_USEC using periph timer 0, freq 1000000, width 32
2020-03-06 14:05:11,081 # ztimer_init(): initializing rtt
2020-03-06 14:05:11,087 # ztimer_init(): ZTIMER_MSEC convert_frac from 32768 to 1000
2020-03-06 14:05:11,092 # Help: Press s to start test, r to print it is ready

Boot output without this patch:

2020-03-06 14:06:13,116 # ztimer_init(): ZTIMER_USEC using periph timer 0, freq 1000000, width 32
2020-03-06 14:06:13,122 # ztimer_init(): ZTIMER_MSEC convert_frac from 1000000 to 1000
2020-03-06 14:06:13,126 # Help: Press s to start test, r to print it is ready

Issues/PRs references

#11874

@jue89 jue89 requested review from bergzand and kaspar030 as code owners March 6, 2020 13:15
@jue89 jue89 changed the title ztimer: fix RTT backend sys/ztimer: fix RTT backend Mar 6, 2020
@jue89
Copy link
Contributor Author

jue89 commented Mar 6, 2020

ztimer ist evolving quickly :D Rebased on master ...

@@ -105,12 +105,12 @@ ztimer_clock_t *const ZTIMER_USEC = &_ztimer_convert_frac_usec.super.super;
#endif

#if MODULE_ZTIMER_MSEC
# if MODULE_PERIPH_TIMER_RTT
static ztimer_periph_timer_rtt_t _ztimer_periph_timer_rtt_msec;
# if MODULE_PERIPH_RTT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups, I thing this happened when renaming ztimer_(periph|rtt|rtc) to ztimer_periph_(timer|rtt|rtc) with search&replace.

@kaspar030
Copy link
Contributor

First of all: congratulations on merging ztimer!

thanks. :)

Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

@kaspar030 kaspar030 added Area: timers Area: timer subsystems Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 6, 2020
@benpicco benpicco merged commit dc89c27 into RIOT-OS:master Mar 6, 2020
@jue89 jue89 deleted the fix/ztimer_rtt branch March 7, 2020 14:44
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Mar 13, 2020
@leandrolanzieri leandrolanzieri added the Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer label Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: timers Area: timer subsystems CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants