diff options
Diffstat (limited to 'applications/freertos/main.cpp')
-rw-r--r-- | applications/freertos/main.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/applications/freertos/main.cpp b/applications/freertos/main.cpp index d579944..712b9a4 100644 --- a/applications/freertos/main.cpp +++ b/applications/freertos/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 Arm Limited. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2019-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> * * SPDX-License-Identifier: Apache-2.0 * @@ -167,7 +167,7 @@ int ethosu_mutex_unlock(void *mutex) { } void *ethosu_semaphore_create(void) { - SemaphoreHandle_t sem = xSemaphoreCreateBinary(); + SemaphoreHandle_t sem = xSemaphoreCreateCounting(255, 0); // max, initial val if (sem == NULL) { printf("Error: Failed to create semaphore.\n"); } @@ -192,10 +192,8 @@ int ethosu_semaphore_give(void *sem) { return -1; } } else { - /* A FreeRTOS binary semaphore is fundamentally a queue that can only hold one item. If the queue is full, - * xSemaphoreGive will return a pdFALSE value. Ignoring the return value in here, as a semaphore give failure - * does not affect the application correctness. */ if (xSemaphoreGive(handle) != pdTRUE) { + printf("Error: Failed to give semaphore.\n"); // do nothing } } |