From 1c893b540454ffd46e72cf0fce9e7e6d962195b5 Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Wed, 26 May 2021 12:06:14 +0200 Subject: Optimizations Removing the ASSERT() makro using assert() instead. assert() is better controlled with the NDEBUG define. Using uintptr_t instead of uint32_t * for the NPU base address. This saves a division by 4 in the register read and write functions. Change-Id: I65a91fe35dc63666e50bdf7a756ad15b56dc66e9 --- src/ethosu_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ethosu_driver.c') diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c index 5910fa4..4c1b100 100644 --- a/src/ethosu_driver.c +++ b/src/ethosu_driver.c @@ -229,7 +229,7 @@ void __attribute__((weak)) ethosu_irq_handler(struct ethosu_driver *drv) // Verify that interrupt has been raised (void)ethosu_is_irq_raised(&drv->dev, &irq_raised); - ASSERT(irq_raised == 1); + assert(irq_raised == 1); drv->irq_triggered = true; // Clear interrupt @@ -237,7 +237,7 @@ void __attribute__((weak)) ethosu_irq_handler(struct ethosu_driver *drv) // Verify that interrupt has been successfully cleared (void)ethosu_is_irq_raised(&drv->dev, &irq_raised); - ASSERT(irq_raised == 0); + assert(irq_raised == 0); if (ethosu_status_has_error(&drv->dev)) { -- cgit v1.2.1