diff options
| author | flyingcys <[email protected]> | 2023-03-29 19:01:26 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-29 19:01:26 +0800 |
| commit | 0cf3bcf49506ee4a8c5444284b0c9dd5afbf2df3 (patch) | |
| tree | ac5dc1fe96fac3bd726cef10e587c8fe33818615 /libcpu | |
| parent | adf17c427fb99b021fd3ab29a62d5aaece9e2268 (diff) | |
[bsp]fix esp32_c3 compile error (#7107)
* fix rt_hw_interrupt_install return value
* add __rt_rvstack
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/risc-v/common/trap_common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcpu/risc-v/common/trap_common.c b/libcpu/risc-v/common/trap_common.c index 2e978f2aed..e7d0043a11 100644 --- a/libcpu/risc-v/common/trap_common.c +++ b/libcpu/risc-v/common/trap_common.c @@ -41,21 +41,26 @@ rt_weak void rt_hw_interrupt_init(void) * @param handler Break-in function requiring binding * @param param NULL * @param name NULL - * @return NULL + * @return old handler */ rt_weak rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, void *param, const char *name) { + rt_isr_handler_t old_handler = RT_NULL; void *user_param = param; char *user_name = name; + if(vector < ISR_NUMBER) { + old_handler = rv32irq_table[vector].handler; if (handler != RT_NULL) { rv32irq_table[vector].handler = (rt_isr_handler_t)handler; rv32irq_table[vector].param = param; } } + + return old_handler; } /** |
