Skip to content

Commit 899f80e

Browse files
committed
[Timer] Fix wrong test value
Wrong copy/paste introduced with #437 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 3bdd8e3 commit 899f80e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: cores/arduino/stm32/timer.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1162,19 +1162,19 @@ void attachIntHandleOC(stimer_t *obj, void (*irqHandle)(void), uint16_t timChann
11621162
break;
11631163
case 2:
11641164
obj->irqHandleOC_CH2 = irqHandle;
1165-
if (HAL_TIM_OC_ConfigChannel(handle, &sConfig, TIM_CHANNEL_2) != HAL_OK) {
1165+
if (HAL_TIM_OC_ConfigChannel(handle, &sConfig, TIM_CHANNEL_2) == HAL_OK) {
11661166
HAL_TIM_OC_Start_IT(handle, TIM_CHANNEL_2);
11671167
}
11681168
break;
11691169
case 3:
11701170
obj->irqHandleOC_CH3 = irqHandle;
1171-
if (HAL_TIM_OC_ConfigChannel(handle, &sConfig, TIM_CHANNEL_3) != HAL_OK) {
1171+
if (HAL_TIM_OC_ConfigChannel(handle, &sConfig, TIM_CHANNEL_3) == HAL_OK) {
11721172
HAL_TIM_OC_Start_IT(handle, TIM_CHANNEL_3);
11731173
}
11741174
break;
11751175
case 4:
11761176
obj->irqHandleOC_CH4 = irqHandle;
1177-
if (HAL_TIM_OC_ConfigChannel(handle, &sConfig, TIM_CHANNEL_4) != HAL_OK) {
1177+
if (HAL_TIM_OC_ConfigChannel(handle, &sConfig, TIM_CHANNEL_4) == HAL_OK) {
11781178
HAL_TIM_OC_Start_IT(handle, TIM_CHANNEL_4);
11791179
}
11801180
break;

0 commit comments

Comments
 (0)