From c43ab4d26250a34e91a51c6a708d917d531fdc6d Mon Sep 17 00:00:00 2001 From: ZYH Date: Tue, 19 Mar 2019 20:39:59 +0800 Subject: [PATCH] [BSP][k210]fix sdk interrupt in rtthread --- bsp/k210/driver/SConscript | 1 + bsp/k210/driver/drv_interrupt.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 bsp/k210/driver/drv_interrupt.c diff --git a/bsp/k210/driver/SConscript b/bsp/k210/driver/SConscript index 75a634227a..8fb62701b2 100644 --- a/bsp/k210/driver/SConscript +++ b/bsp/k210/driver/SConscript @@ -8,6 +8,7 @@ board.c heap.c drv_uart.c drv_io_config.c +drv_interrupt.c ''') CPPPATH = [cwd] diff --git a/bsp/k210/driver/drv_interrupt.c b/bsp/k210/driver/drv_interrupt.c new file mode 100644 index 0000000000..62e899dba8 --- /dev/null +++ b/bsp/k210/driver/drv_interrupt.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-03-19 ZYH first version + */ + +#include + +void plic_irq_handle(plic_irq_t irq) +{ + plic_instance_t (*plic_instance)[IRQN_MAX] = plic_get_instance(); + if (plic_instance[0][irq].callback) + { + plic_instance[0][irq].callback( + plic_instance[0][irq].ctx); + } + else if (plic_instance[1][irq].callback) + { + plic_instance[1][irq].callback( + plic_instance[1][irq].ctx); + } +} +