Defining the interrupt service routine

This commit is contained in:
Rajput R Vikramsingh Vikramsingh 2024-09-19 23:03:03 +05:30
parent d667194c3e
commit 1970542dc8
1 changed files with 32 additions and 1 deletions

View File

@ -55,7 +55,38 @@ void GPIOF_Int_Config()
} }
void GPIOF_INT_Handler(void)
{
GPIO_PORTF_IM_R &= ~MASK_BITS;
int i;
if(GPIO_PORTF_RIS_R & 0x01)
{
for(i=0;i<160000;i++){}
if(~(GPIO_PORTF_DATA_R)&0x01)
{
if(PWM1_2_CMPB_R < 155)
{
PWM1_2_CMPB_R += 5;
}
}
}
if(GPIO_PORTF_RIS_R & 0x10)
{
for(i=0;i<160000;i++){}
if(~(GPIO_PORTF_DATA_R)&0x10)
{
if(PWM1_2_CMPB_R > 5)
{
PWM1_2_CMPB_R -= 5;
}
}
}
GPIO_PORTF_ICR_R = MASK_BITS;
GPIO_PORTF_IM_R |= MASK_BITS;
}