summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/system-x1000.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-06-05 11:58:17 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-06-06 11:06:43 +0000
commit2b23d3ecaf2074ad640f66ff198b6043f3ea9e6e (patch)
tree465de543e13bcada2ffe2ba7346a10d57fdbe0be /firmware/target/mips/ingenic_x1000/system-x1000.c
parente85bc74b307365e9a7b4adab51d646638db12fbd (diff)
downloadrockbox-2b23d3ecaf2074ad640f66ff198b6043f3ea9e6e.tar.gz
rockbox-2b23d3ecaf2074ad640f66ff198b6043f3ea9e6e.zip
x1000: Allow setting IRQ handlers dynamically
Avoids having to #define the names of GPIO pin interrupt handlers, as they can now be set at runtime instead. Change-Id: Ib5da1bdb475ff7b64280fe7cdd00adab63389152
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/system-x1000.c')
-rw-r--r--firmware/target/mips/ingenic_x1000/system-x1000.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/target/mips/ingenic_x1000/system-x1000.c b/firmware/target/mips/ingenic_x1000/system-x1000.c
index c0b0dbc65e..779bb2055c 100644
--- a/firmware/target/mips/ingenic_x1000/system-x1000.c
+++ b/firmware/target/mips/ingenic_x1000/system-x1000.c
@@ -233,7 +233,7 @@ intr(OST);
233 233
234#undef intr 234#undef intr
235 235
236static void(*const irqvector[])(void) = { 236static void(*irqvector[])(void) = {
237 /* ICSR0: 0 - 31 */ 237 /* ICSR0: 0 - 31 */
238 DMIC, AIC, UIRQ, UIRQ, UIRQ, UIRQ, UIRQ, SFC, 238 DMIC, AIC, UIRQ, UIRQ, UIRQ, UIRQ, UIRQ, SFC,
239 SSI0, UIRQ, PDMA, PDMAD, UIRQ, UIRQ, UIRQ, UIRQ, 239 SSI0, UIRQ, PDMA, PDMAD, UIRQ, UIRQ, UIRQ, UIRQ,
@@ -263,6 +263,13 @@ static void(*const irqvector[])(void) = {
263 GPIOD00, GPIOD01, GPIOD02, GPIOD03, GPIOD04, GPIOD05, 263 GPIOD00, GPIOD01, GPIOD02, GPIOD03, GPIOD04, GPIOD05,
264}; 264};
265 265
266irq_handler_t system_set_irq_handler(int irq, irq_handler_t handler)
267{
268 irq_handler_t old_handler = irqvector[irq];
269 irqvector[irq] = handler;
270 return old_handler;
271}
272
266void system_enable_irq(int irq) 273void system_enable_irq(int irq)
267{ 274{
268 if(IRQ_IS_GROUP0(irq)) { 275 if(IRQ_IS_GROUP0(irq)) {