aboutsummaryrefslogtreecommitdiff
path: root/applications/threadx_demo/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'applications/threadx_demo/main.cpp')
-rw-r--r--applications/threadx_demo/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/applications/threadx_demo/main.cpp b/applications/threadx_demo/main.cpp
index 1211c78..c77c758 100644
--- a/applications/threadx_demo/main.cpp
+++ b/applications/threadx_demo/main.cpp
@@ -1,6 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright 2019-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
- *
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
@@ -192,13 +191,15 @@ void *ethosu_semaphore_create(void) {
return (void *)semaphore;
}
-int ethosu_semaphore_take(void *sem) {
+int ethosu_semaphore_take(void *sem, uint64_t timeout) {
UINT status;
- status = tx_semaphore_get(reinterpret_cast<TX_SEMAPHORE *>(sem), TX_WAIT_FOREVER);
+ status = tx_semaphore_get(reinterpret_cast<TX_SEMAPHORE *>(sem), (ULONG)timeout);
if (status != TX_SUCCESS) {
- printf("Semaphore get/take, error - %u\n", status);
+ if (status != TX_NO_INSTANCE) {
+ printf("Semaphore get/take, error - %u\n", status);
+ }
return -1;
}