2021-04-16 06:17 AM
I have development board of STM8L152R8. I want process like after uart interrupt comes controller should exit from halt mode . and after completing the routine it goes in halt mode again.
I didn't find example regarding this subject.
please help me to find the solution
thanks and regards
Deoyani
2021-04-21 05:42 AM
And after changing it to GPIO_Mode_In_PU_IT I am getting the result as you said .
Thank you
2021-04-22 12:20 AM
:thumbs_up:
2021-04-22 02:48 AM
void EXTI_setup(void)
{
disableInterrupts();
GPIO_Init(GPIOC, GPIO_Pin_0, GPIO_Mode_In_PU_IT);
EXTI_DeInit();
EXTI_ClearITPendingBit(EXTI_IT_Pin0); //to be absolutely sure
EXTI_SetPinSensitivity(EXTI_Pin_0, EXTI_Trigger_Rising_Falling);
enableInterrupts();
}
/**
* @brief external interrput handler .
ResetRegistration Switch Interrupt handler
* @param None
* @retval None
*/
void ButtonIntHandler (void)
{
if (EXTI_GetITStatus(EXTI_IT_Pin0))
{
exti_signal = 1;
ResetRegistration();
}
else if (EXTI_GetITStatus(EXTI_IT_Pin1))
{
//boollocklocked=IsLock();
//ui8PreviousState=ui8CurrentState;
//ui8CurrentState=STATE_MOTOR_CONTROL;
}
EXTI_ClearITPendingBit(EXTI_IT_Pin0);
EXTI_ClearITPendingBit(EXTI_IT_Pin1);
}
Is this above code correct for 2 exti interrupt ,
With this code I am getting interrupt correctly for sometime , and for sometime , not getting interrupt .
Am I missed out something in configuring or clearing Interrupt ?
Please help me to resolve this problem.
Thanks and Regards
Deoyani
2021-04-22 05:30 AM
"Is this above code correct for 2 exti interrupt"
No.
You seem to want to use two GPIO with EXTI but you configure only one.
2021-04-22 10:39 PM
Sorry I have not share you the configuration of 2nd GPIO , But I have configure in another file .
but my handler is same.
Is this the problem?
thanks and regards
Deoyani
2021-04-25 02:12 AM
"Is this the problem?"
Not if that code is called. Try single stepping and see where / when it does or doesn't work.