diff --git a/sched/irq/irq_attach_thread.c b/sched/irq/irq_attach_thread.c index 8c893a3002d..5e48a67f551 100644 --- a/sched/irq/irq_attach_thread.c +++ b/sched/irq/irq_attach_thread.c @@ -72,8 +72,10 @@ static int irq_default_handler(int irq, FAR void *regs, FAR void *arg) FAR struct irq_thread_info_s *info = arg; int ret = IRQ_WAKE_THREAD; - DEBUGASSERT(info->handler != NULL); - ret = info->handler(irq, regs, info->arg); + if (info->handler != NULL) + { + ret = info->handler(irq, regs, info->arg); + } if (ret == IRQ_WAKE_THREAD) { @@ -133,7 +135,7 @@ static int isr_thread_main(int argc, FAR char *argv[]) * irq - Irq num * isr - Function to be called when the IRQ occurs, called in interrupt * context. - * If isr is NULL the default handler is installed(irq_default_handler). + * If isr is NULL, isrthread will be called. * isrthread - called in thread context, If the isrthread is NULL, * then the ISR is being detached. * arg - privdate data diff --git a/sched/irq/irq_attach_wqueue.c b/sched/irq/irq_attach_wqueue.c index 7a63d8caccc..3c8554bd5e7 100644 --- a/sched/irq/irq_attach_wqueue.c +++ b/sched/irq/irq_attach_wqueue.c @@ -128,9 +128,12 @@ static void irq_work_handler(FAR void *arg) static int irq_default_handler(int irq, FAR void *regs, FAR void *arg) { FAR struct irq_work_info_s *info = arg; - int ret; + int ret = IRQ_WAKE_THREAD; - ret = info->handler(irq, regs, arg); + if (info->handler != NULL) + { + ret = info->handler(irq, regs, info->arg); + } if (ret == IRQ_WAKE_THREAD) { @@ -156,7 +159,7 @@ static int irq_default_handler(int irq, FAR void *regs, FAR void *arg) * irq - Irq num * isr - Function to be called when the IRQ occurs, called in interrupt * context. - * If isr is NULL the default handler is installed(irq_default_handler). + * If isr is NULL, isrthread will be called. * isrwork - called in thread context, If the isrwork is NULL, * then the ISR is being detached. * arg - privdate data