Compare commits

...

2 Commits

1 changed files with 45 additions and 3 deletions

View File

@ -42,9 +42,51 @@ void GPIOF_config()
} }
void GPIOF_Int_Config()
{
GPIO_PORTF_IM_R &= ~MASK_BITS;
GPIO_PORTF_IS_R &= ~MASK_BITS;
GPIO_PORTF_IEV_R &= ~MASK_BITS;
GPIO_PORTF_IBE_R &= ~MASK_BITS;
NVIC_PRI7_R = (NVIC_PRI7_R & 0xFF1FFFFF) | (2 << 21);
NVIC_EN0_R |= (1 << 30);
GPIO_PORTF_ICR_R = MASK_BITS;
GPIO_PORTF_IM_R |= MASK_BITS;
}
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;
}