File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -139,10 +139,10 @@ void lp_ticker_init(void)
139
139
LptimHandle .Init .OutputPolarity = LPTIM_OUTPUTPOLARITY_HIGH ;
140
140
LptimHandle .Init .UpdateMode = LPTIM_UPDATE_IMMEDIATE ;
141
141
LptimHandle .Init .CounterSource = LPTIM_COUNTERSOURCE_INTERNAL ;
142
- #if ( TARGET_STM32L4 )
142
+ #if defined ( LPTIM_INPUT1SOURCE_GPIO ) /* STM32L4 */
143
143
LptimHandle .Init .Input1Source = LPTIM_INPUT1SOURCE_GPIO ;
144
144
LptimHandle .Init .Input2Source = LPTIM_INPUT2SOURCE_GPIO ;
145
- #endif /* TARGET_STM32L4 */
145
+ #endif /* LPTIM_INPUT1SOURCE_GPIO */
146
146
147
147
if (HAL_LPTIM_Init (& LptimHandle ) != HAL_OK ) {
148
148
error ("HAL_LPTIM_Init ERROR\n" );
@@ -151,7 +151,7 @@ void lp_ticker_init(void)
151
151
152
152
NVIC_SetVector (LPTIM1_IRQn , (uint32_t )LPTIM1_IRQHandler );
153
153
154
- #if !( TARGET_STM32L4 )
154
+ #if defined ( __HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_IT )
155
155
/* EXTI lines are not configured by default */
156
156
__HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_IT ();
157
157
__HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE ();
@@ -190,7 +190,8 @@ static void LPTIM1_IRQHandler(void)
190
190
}
191
191
}
192
192
193
- #if !(TARGET_STM32L4 )
193
+ #if defined (__HAL_LPTIM_WAKEUPTIMER_EXTI_CLEAR_FLAG )
194
+ /* EXTI lines are not configured by default */
194
195
__HAL_LPTIM_WAKEUPTIMER_EXTI_CLEAR_FLAG ();
195
196
#endif
196
197
}
You can’t perform that action at this time.
0 commit comments