Skip to content

Commit 9b9f679

Browse files
Andre GuedesAnas Nashif
authored andcommitted
tests/power/multicorei/lmt: Fix RTC configuration
After QMSI 1.4 update, the alarm callback is not saved when 'alarm_en' is set to zero during RTC configuration. So this patch fixes tests/power/multicore/lmt application according. ZEP-1778 Change-Id: Ie1468458bc23a6394484aef2aeee97745d5d23b8 Signed-off-by: Andre Guedes <[email protected]> (cherry picked from commit c7f01dc)
1 parent 6b0903b commit 9b9f679

File tree

1 file changed

+8
-2
lines changed
  • tests/power/multicore/lmt/src

1 file changed

+8
-2
lines changed

tests/power/multicore/lmt/src/main.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,15 @@ void main(void)
137137

138138
rtc_enable(rtc_dev);
139139

140-
config.init_val = 0;
141-
config.alarm_enable = 0;
140+
/* In QMSI, in order to save the alarm callback we must set
141+
* 'alarm_enable = 1' during configuration. However, this
142+
* automatically triggers the alarm underneath. So, to avoid
143+
* the alarm being fired any time soon, we set the 'init_val'
144+
* to 1 and the 'alarm_val' to 0.
145+
*/
146+
config.init_val = 1;
142147
config.alarm_val = 0;
148+
config.alarm_enable = 1;
143149
config.cb_fn = alarm_handler;
144150
rtc_set_config(rtc_dev, &config);
145151

0 commit comments

Comments
 (0)