Interrupt value does not get reset
I am using timer 4 in STM32G431 to read hall sensor input and trigger interrupt when high .


.
Above is my setting.
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1)
{
_hallA = HAL_TIM_ReadCapturedValue(htim,TIM_CHANNEL_1);
if(_hallA != 0x00U)
{
TIM1->CCR2 = 40000;
}
else
{
TIM1->CCR2 = 10000;
}
}
I check for if my hallA is equal to 1.The interrupt gets triggered and sets CCR2 value to 40000.
but when i change my hallA value to 0,it does not change the value of CCR2(CRR2 has contant value of 40000,whether hallA is 1 or 0)
I want to change the value of CCR2 ,depending upon the hallA value.
I don't understand what setting is wrong?
