mirror of https://github.com/ARMmbed/mbed-os.git
PSOC6_FUTURE: Fix circular dependency for GPIO-IRQ
The use of `gpio_irq_event` & `gpio_irq_handler` in `gpio_irq_s` creates a circular dependency. hal/gpio_irq_api.h needs targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/TARGET_CY8C63XX/device.h, that needs targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/objects.h, that again needs hal/gpio_irq_api.h, before the types are defined. Remove `#include "gpio_irq_api.h"` directive from objects.h and change the types of `gpio_irq_s` members.pull/11074/head
parent
5ee22d0c24
commit
844864066a
|
@ -49,7 +49,7 @@ static void gpio_irq_dispatcher(uint32_t port_id)
|
|||
MBED_ASSERT(obj);
|
||||
Cy_GPIO_ClearInterrupt(port, pin);
|
||||
event = (obj->mode == IRQ_FALL)? IRQ_FALL : IRQ_RISE;
|
||||
obj->handler(obj->id_arg, event);
|
||||
((gpio_irq_handler) obj->handler)(obj->id_arg, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
|
|||
MBED_ASSERT("Invalid pin ID!");
|
||||
return (-1);
|
||||
}
|
||||
obj->handler = handler;
|
||||
obj->handler = (uint32_t) handler;
|
||||
obj->id_arg = id;
|
||||
return gpio_irq_setup_channel(obj);
|
||||
} else {
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "PinNames.h"
|
||||
#include "PortNames.h"
|
||||
|
||||
#include "gpio_irq_api.h"
|
||||
#include "gpio_object.h"
|
||||
#include "cy_sysclk.h"
|
||||
#include "cy_syspm.h"
|
||||
|
@ -37,8 +36,8 @@ struct gpio_irq_s {
|
|||
GPIO_PRT_Type* port;
|
||||
uint32_t port_id;
|
||||
uint32_t pin;
|
||||
gpio_irq_event mode;
|
||||
gpio_irq_handler handler;
|
||||
uint32_t mode;
|
||||
uint32_t handler;
|
||||
uint32_t id_arg;
|
||||
#if defined (TARGET_MCU_PSOC6_M0)
|
||||
cy_en_intr_t cm0p_irq_src;
|
||||
|
|
Loading…
Reference in New Issue