Skip to content

Commit 63c5c7d

Browse files
committed
Fix issue in case of MBED_HEAP_STATS_ENABLED enabled
Add a workaround in lp_ticker_init function for CI tests
1 parent 8adb393 commit 63c5c7d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

targets/TARGET_STM/lp_ticker.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ void lp_ticker_init(void)
4545

4646
rtc_init();
4747
rtc_set_irq_handler((uint32_t) lp_ticker_irq_handler);
48+
49+
#ifdef MBED_HEAP_STATS_ENABLED
50+
/* rtc_read is using mktime function which is calling at the first time __wrap__free_r */
51+
/* __wrap__free_r needs to initialize Singleton not in ISR */
52+
/* rtc_read is called at each ticker setup which call core_util_critical_section_enter */
53+
/* so rtc_read is called once once before other calls */
54+
rtc_read();
55+
#endif /* MBED_HEAP_STATS_ENABLED */
4856
}
4957

5058
uint32_t lp_ticker_read(void)

0 commit comments

Comments
 (0)