Skip to content

Commit 58a4685

Browse files
committed
STM32: lp_ticker optim: initialize handle once only
1 parent ee95c7e commit 58a4685

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

targets/TARGET_STM/lp_ticker.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ static void LPTIM1_IRQHandler(void)
203203
{
204204
core_util_critical_section_enter();
205205

206-
LptimHandle.Instance = LPTIM1;
207-
208206
if (lp_Fired) {
209207
lp_Fired = 0;
210208
/* We're already in handler and interrupt might be pending,
@@ -259,7 +257,6 @@ uint32_t lp_ticker_read(void)
259257
/* This function should always be called from critical section */
260258
void lp_ticker_set_interrupt(timestamp_t timestamp)
261259
{
262-
LptimHandle.Instance = LPTIM1;
263260
core_util_critical_section_enter();
264261

265262
/* Always store the last requested timestamp */
@@ -348,15 +345,13 @@ void lp_ticker_disable_interrupt(void)
348345
lp_Fired = 0;
349346
NVIC_DisableIRQ(LPTIM1_IRQn);
350347
NVIC_ClearPendingIRQ(LPTIM1_IRQn);
351-
LptimHandle.Instance = LPTIM1;
352348

353349
core_util_critical_section_exit();
354350
}
355351

356352
void lp_ticker_clear_interrupt(void)
357353
{
358354
core_util_critical_section_enter();
359-
LptimHandle.Instance = LPTIM1;
360355
__HAL_LPTIM_CLEAR_FLAG(&LptimHandle, LPTIM_FLAG_CMPM);
361356
NVIC_ClearPendingIRQ(LPTIM1_IRQn);
362357
core_util_critical_section_exit();

0 commit comments

Comments
 (0)