aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2023-02-16 11:34:52 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2023-02-16 12:59:56 +0100
commit00b8e7beb4fef59c5bef3bc963dfff5bd11718b6 (patch)
tree76046dd845f906e24499d45c0a26a4cd22efb9b6
parente0b078b385258002f6829481a78ce4fc51cac34a (diff)
downloadethos-u-core-platform-00b8e7beb4fef59c5bef3bc963dfff5bd11718b6.tar.gz
Update baremetal systick timer handling23.02-rc223.02
Use the ethosuDrv pointer to signal if the systick handler should be restarted. Change-Id: Id47b37ab773970317ab324b95706ea54d7dcc74a
-rw-r--r--applications/baremetal/main.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/applications/baremetal/main.cpp b/applications/baremetal/main.cpp
index d27e4a4..20bc756 100644
--- a/applications/baremetal/main.cpp
+++ b/applications/baremetal/main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2022 Arm Limited. All rights reserved.
+ * SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -89,10 +89,12 @@ void SysTick_Handler(void) {
// Disable systick, preventing new systick interrupt to fire while we call the Ethos-U monitor
SysTick->CTRL = 0;
- ethosuMonitor.monitorSample(ethosuDrv);
+ if (ethosuDrv != nullptr) {
+ ethosuMonitor.monitorSample(ethosuDrv);
- // Restart the systick timer
- SysTick_Config(delay);
+ // Restart the systick timer
+ SysTick_Config(delay);
+ }
}
void ethosu_inference_begin(struct ethosu_driver *drv, void *) {
@@ -105,7 +107,7 @@ void ethosu_inference_end(struct ethosu_driver *drv, void *) {
// Disable polling
SysTick->CTRL = 0;
- ethosuDrv = 0;
+ ethosuDrv = nullptr;
ethosuMonitor.monitorSample(drv);
ethosuMonitor.release(drv);
}