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

kinetis: Adjust RTT alarm trigger time #7476

Merged
merged 1 commit into from Oct 9, 2017

Conversation

jnohlgard
Copy link
Member

The RTT alarm will trigger when the RTT seconds register is equal to the set alarm target, instead of triggering at the following second. This makes the API behave more like what users seem to expect.

Fixes #6331 for Kinetis

The RTT alarm will trigger when the RTT seconds register is equal to the
set alarm target, instead of triggering at the following second.
@jnohlgard jnohlgard added Platform: ARM Platform: This PR/issue effects ARM-based platforms Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR labels Aug 15, 2017
@jnohlgard jnohlgard added this to the Release 2017.10 milestone Aug 15, 2017
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

I'm fine with the changes here (I trust you with the CPU reference manual @gebart).
Just one comment about the minimal alarm value in this case.

RTC_Type *rtt = RTT_DEV;

/* Disable Timer Alarm Interrupt */
rtt->IER &= ~(RTC_IER_TAIE_MASK);

rtt->TAR = alarm;
rtt->TAR = alarm - 1;
Copy link
Contributor

@aabadie aabadie Sep 13, 2017

Choose a reason for hiding this comment

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

What happens if one passes 0 as alarm ? It doesn't make sense but maybe we should ensure alarm is greater than 1 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should actually still be correct, the alarm will be set to trigger when the counter is equal to 0xffffffff and increments, i.e. when the counter turns 0.

@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 13, 2017
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Un-tested ACK (+1 for fixing the RTT 1s delay)

@kYc0o
Copy link
Contributor

kYc0o commented Oct 9, 2017

Tested ACK. Go!

@kYc0o kYc0o merged commit 52efba5 into RIOT-OS:master Oct 9, 2017
@jnohlgard
Copy link
Member Author

Thanks!

@jnohlgard jnohlgard deleted the pr/kinetis-rtt-alarm branch October 9, 2017 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants