File tree 1 file changed +10
-3
lines changed
targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ extern "C"
11
11
uint32_t ap3_gpio_enable_interrupts (uint32_t ui32Pin , am_hal_gpio_intdir_e eIntDir );
12
12
/** GPIO IRQ HAL structure. gpio_irq_s is declared in the target's HAL
13
13
*/
14
- typedef struct gpio_irq_s gpio_irq_t ;
14
+ n // typedef struct gpio_irq_s gpio_irq_t;
15
15
16
- typedef void (* gpio_irq_handler )(uint32_t id , gpio_irq_event event );
16
+ // typedef void (*gpio_irq_handler)(uint32_t id, gpio_irq_event event);
17
17
extern void am_gpio_isr (void );
18
18
static ap3_gpio_irq_control_t gpio_irq_control [AP3_GPIO_MAX_PADS ];
19
19
@@ -78,7 +78,14 @@ extern "C"
78
78
{
79
79
am_hal_gpio_interrupt_clear (AM_HAL_GPIO_BIT (pinNum ));
80
80
ap3_gpio_irq_control_t irq_ctrl = gpio_irq_control [pinNum ];
81
- ((gpio_irq_handler )irq_ctrl .handler )(irq_ctrl .id , irq_ctrl .events );
81
+ uint8_t enabledEvents = irq_ctrl .events ;
82
+ //Can't check if a rise or a fall caused the interrupt, must assume source from what is enabled
83
+ if (enabledEvents == (IRQ_RISE | IRQ_FALL ))
84
+ {
85
+ //if both are enabled we have to just assume it game from the rise, its the best we can do
86
+ enabledEvents = IRQ_RISE ;
87
+ }
88
+ ((gpio_irq_handler )irq_ctrl .handler )(irq_ctrl .id , enabledEvents );
82
89
}
83
90
gpio_int_mask >>= 1 ;
84
91
pinNum ++ ;
You can’t perform that action at this time.
0 commit comments