mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
First pass update BLE stack
This commit is contained in:
29
source/Core/BSP/Pinecilv2/bl_irq.c
Normal file
29
source/Core/BSP/Pinecilv2/bl_irq.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "bl_irq.h"
|
||||
|
||||
extern pFunc __Interrupt_Handlers[IRQn_LAST];
|
||||
|
||||
void bl_irq_enable(unsigned int source) { *(volatile uint8_t *)(CLIC_HART0_ADDR + CLIC_INTIE + source) = 1; }
|
||||
|
||||
void bl_irq_disable(unsigned int source) { *(volatile uint8_t *)(CLIC_HART0_ADDR + CLIC_INTIE + source) = 0; }
|
||||
|
||||
void bl_irq_pending_set(unsigned int source) { *(volatile uint8_t *)(CLIC_HART0_ADDR + CLIC_INTIP + source) = 1; }
|
||||
|
||||
void bl_irq_pending_clear(unsigned int source) { *(volatile uint8_t *)(CLIC_HART0_ADDR + CLIC_INTIP + source) = 0; }
|
||||
|
||||
void bl_irq_register(int irqnum, void *handler) {
|
||||
if (irqnum < IRQn_LAST) {
|
||||
__Interrupt_Handlers[irqnum] = handler;
|
||||
}
|
||||
}
|
||||
|
||||
void bl_irq_unregister(int irqnum, void *handler) {
|
||||
if (irqnum < IRQn_LAST) {
|
||||
__Interrupt_Handlers[irqnum] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void bl_irq_handler_get(int irqnum, void **handler) {
|
||||
if (irqnum < IRQn_LAST) {
|
||||
*handler = __Interrupt_Handlers[irqnum];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user