Skip to content

Commit

Permalink
Merge pull request #134 from UAVCAN/master_upstream_nuttx_irq_changes
Browse files Browse the repository at this point in the history
Support upstream NuttX IRQ API changes
  • Loading branch information
pavel-kirienko committed Jun 12, 2018
2 parents 883cba9 + 7764a92 commit 231b221
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libuavcan_drivers/stm32/driver/src/internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# define UAVCAN_STM32_IRQ_PROLOGUE() CH_IRQ_PROLOGUE()
# define UAVCAN_STM32_IRQ_EPILOGUE() CH_IRQ_EPILOGUE()
#elif UAVCAN_STM32_NUTTX
# define UAVCAN_STM32_IRQ_HANDLER(id) int id(int irq, FAR void* context)
# define UAVCAN_STM32_IRQ_HANDLER(id) int id(int irq, FAR void* context, FAR void *arg)
# define UAVCAN_STM32_IRQ_PROLOGUE()
# define UAVCAN_STM32_IRQ_EPILOGUE() return 0;
#else
Expand Down
10 changes: 5 additions & 5 deletions libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
# endif
extern "C"
{
static int can1_irq(const int irq, void*);
static int can1_irq(const int irq, void*, void*);
#if UAVCAN_STM32_NUM_IFACES > 1
static int can2_irq(const int irq, void*);
static int can2_irq(const int irq, void*, void*);
#endif
}
#endif
Expand Down Expand Up @@ -1010,7 +1010,7 @@ void CanDriver::initOnce()
#if UAVCAN_STM32_NUTTX
# define IRQ_ATTACH(irq, handler) \
{ \
const int res = irq_attach(irq, handler); \
const int res = irq_attach(irq, handler, NULL); \
(void)res; \
assert(res >= 0); \
up_enable_irq(irq); \
Expand Down Expand Up @@ -1119,7 +1119,7 @@ extern "C"

#if UAVCAN_STM32_NUTTX

static int can1_irq(const int irq, void*)
static int can1_irq(const int irq, void*, void*)
{
if (irq == STM32_IRQ_CAN1TX)
{
Expand All @@ -1142,7 +1142,7 @@ static int can1_irq(const int irq, void*)

# if UAVCAN_STM32_NUM_IFACES > 1

static int can2_irq(const int irq, void*)
static int can2_irq(const int irq, void*, void*)
{
if (irq == STM32_IRQ_CAN2TX)
{
Expand Down
2 changes: 1 addition & 1 deletion libuavcan_drivers/stm32/driver/src/uc_stm32_clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void init()
# if UAVCAN_STM32_NUTTX

// Attach IRQ
irq_attach(TIMX_IRQn, &TIMX_IRQHandler);
irq_attach(TIMX_IRQn, &TIMX_IRQHandler, NULL);

// Power-on and reset
modifyreg32(STM32_RCC_APB1ENR, 0, TIMX_RCC_ENR_MASK);
Expand Down

0 comments on commit 231b221

Please sign in to comment.