add GPIO interrupt Handler
This commit is contained in:
parent
e10fba555b
commit
34d0ad34a2
|
@ -67,3 +67,24 @@ void SystickHandler(void)
|
|||
}
|
||||
}
|
||||
|
||||
void GPIOF_interruptHandler(void)
|
||||
{
|
||||
delay(200000); // Debounce delay
|
||||
if (GPIO_PORTF_RIS_R & 0x01) // Check if PF0 caused the interrupt (Switch 1)
|
||||
{
|
||||
duty += 5; // Increase duty cycle
|
||||
if (duty > 100) duty = 100; // Limit to max 100%
|
||||
GPIO_PORTF_ICR_R = 0x01; // Clear interrupt flag for PF0
|
||||
// systick_setting();
|
||||
}
|
||||
|
||||
if (GPIO_PORTF_RIS_R & 0x10)
|
||||
{ // Check if PF0 caused the interrupt (Switch 1)
|
||||
duty -= 5; // Increase duty cycle
|
||||
if (duty < 0) duty = 0; // Limit to max 100%
|
||||
GPIO_PORTF_ICR_R = 0x10; // Clear interrupt flag for PF0
|
||||
//systick_setting();
|
||||
}
|
||||
systick_setting();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue