Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
7d849b41
Verified
Commit
7d849b41
authored
Aug 17, 2019
by
Rahix
Browse files
fix(rtc): Trigger immediately if alarm is scheduled in the past
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
886443ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/rtc.c
View file @
7d849b41
...
...
@@ -58,6 +58,15 @@ int epic_rtc_schedule_alarm(uint32_t timestamp)
{
int
res
;
/*
* Check if the timestamp lies in the past and if so, trigger
* immediately.
*/
if
(
epic_rtc_get_seconds
()
>=
timestamp
)
{
api_interrupt_trigger
(
EPIC_INT_RTC_ALARM
);
return
0
;
}
NVIC_EnableIRQ
(
RTC_IRQn
);
while
((
res
=
RTC_SetTimeofdayAlarm
(
MXC_RTC
,
timestamp
))
==
E_BUSY
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment