diff options
-rw-r--r-- | applications/baremetal/main.cpp | 12 |
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); } |