aboutsummaryrefslogtreecommitdiff
path: root/src/ethosu_driver.c
diff options
context:
space:
mode:
authorPer Åstrand <per.astrand@arm.com>2020-04-21 14:19:44 +0200
committerKristofer Jonsson <kristofer.jonsson@arm.com>2020-05-11 07:12:51 +0000
commit25d78c0062908e91b4d0ae241600f4a077a19400 (patch)
tree58e2c3441a6c24b4fe6a55bc7fa7f6084643d62a /src/ethosu_driver.c
parent537c71cb602871b9957eeb07bca4d5740a2e7eb4 (diff)
downloadethos-u-core-driver-25d78c0062908e91b4d0ae241600f4a077a19400.tar.gz
MLBEDSW-1796 Refactor IRQ initialization
Turn the IRQ initialization around, to have the application define the interrupt handler and expose the driver routine that is to be called when that happens. Change-Id: Idbfba1b1d1a1eaf6678ee16e9583c496eb2287ed
Diffstat (limited to 'src/ethosu_driver.c')
-rw-r--r--src/ethosu_driver.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c
index 567c878..3bad2ac 100644
--- a/src/ethosu_driver.c
+++ b/src/ethosu_driver.c
@@ -20,8 +20,9 @@
#include "ethosu_common.h"
#include "ethosu_device.h"
-#include "irq_driver.h"
+
#include <assert.h>
+#include <cmsis_compiler.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
@@ -34,7 +35,7 @@ static int abort_inference = false;
static volatile bool irq_triggered = false;
#if defined(CPU_CORTEX_M3) || defined(CPU_CORTEX_M4) || defined(CPU_CORTEX_M7) || defined(CPU_CORTEX_M33) || \
defined(CPU_CORTEX_M55)
-void irq_handler()
+void ethosu_irq_handler(void)
{
uint8_t irq_raised = 0;
(void)ethosu_is_irq_raised(&irq_raised);
@@ -56,13 +57,12 @@ static inline void wait_for_irq(void)
break;
}
- sleep();
+ __WFI();
__enable_irq();
}
}
#else
-#define setup_irq(...)
// Just polling the status register
static inline void wait_for_irq(void)
{
@@ -198,8 +198,6 @@ int ethosu_init(void)
return -1;
}
- setup_irq(&irq_handler, EthosuIrq);
-
return_code = ethosu_dev_init();
return return_code;