From 244a310a799a414c38c7e9f4bb757319f9bb6866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonny=20Sv=C3=A4rd?= Date: Mon, 18 Dec 2023 18:26:44 +0100 Subject: Add app support for core_driver inference timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update example applications to support new core_driver inference timeout feature. Change-Id: Ib7283421aa8db9a3b5f1dd6d1bd44803491f0399 Signed-off-by: Jonny Svärd --- applications/message_handler_openamp/core_driver_mutex.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'applications/message_handler_openamp') diff --git a/applications/message_handler_openamp/core_driver_mutex.cpp b/applications/message_handler_openamp/core_driver_mutex.cpp index d023ad2..7948bd0 100644 --- a/applications/message_handler_openamp/core_driver_mutex.cpp +++ b/applications/message_handler_openamp/core_driver_mutex.cpp @@ -1,6 +1,5 @@ /* * SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates - * * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the License); you may @@ -52,10 +51,10 @@ void *ethosu_semaphore_create(void) { return xSemaphoreCreateCounting(255, 0); } -int ethosu_semaphore_take(void *sem) { +int ethosu_semaphore_take(void *sem, uint64_t timeout) { SemaphoreHandle_t handle = reinterpret_cast(sem); - if (xSemaphoreTake(handle, portMAX_DELAY) != pdTRUE) { - printf("Error: Failed to take semaphore.\n"); + if (xSemaphoreTake(handle, (TickType_t)timeout) != pdTRUE) { + // Semaphore take timed out return -1; } return 0; -- cgit v1.2.1