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.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/applications/threadx_demo/main.cpp b/applications/threadx_demo/main.cpp
index 0eaa55e..1211c78 100644
--- a/applications/threadx_demo/main.cpp
+++ b/applications/threadx_demo/main.cpp
@@ -141,7 +141,7 @@ void *ethosu_mutex_create(void) {
mutex = new TX_MUTEX;
status = tx_mutex_create(mutex, nullptr, TX_NO_INHERIT);
if (status != TX_SUCCESS) {
- printf("mutex create failed, error - %d\n", status);
+ printf("mutex create failed, error - %u\n", status);
}
return (void *)mutex;
}
@@ -156,7 +156,7 @@ int ethosu_mutex_lock(void *mutex) {
status = tx_mutex_get(reinterpret_cast<TX_MUTEX *>(mutex), TX_WAIT_FOREVER);
if (status != TX_SUCCESS) {
- printf("mutex get failed, error - %d\n", status);
+ printf("mutex get failed, error - %u\n", status);
return -1;
}
return 0;
@@ -172,7 +172,7 @@ int ethosu_mutex_unlock(void *mutex) {
status = tx_mutex_put(reinterpret_cast<TX_MUTEX *>(mutex));
if (status != TX_SUCCESS) {
- printf("mutex put failed, error - %d\n", status);
+ printf("mutex put failed, error - %u\n", status);
return -1;
}
return 0;
@@ -186,7 +186,7 @@ void *ethosu_semaphore_create(void) {
status = tx_semaphore_create(semaphore, nullptr, 0);
if (status != TX_SUCCESS) {
- printf("Semaphore create failed, error - %d\n", status);
+ printf("Semaphore create failed, error - %u\n", status);
}
return (void *)semaphore;
@@ -198,7 +198,7 @@ int ethosu_semaphore_take(void *sem) {
status = tx_semaphore_get(reinterpret_cast<TX_SEMAPHORE *>(sem), TX_WAIT_FOREVER);
if (status != TX_SUCCESS) {
- printf("Semaphore get/take, error - %d\n", status);
+ printf("Semaphore get/take, error - %u\n", status);
return -1;
}
@@ -211,7 +211,7 @@ int ethosu_semaphore_give(void *sem) {
status = tx_semaphore_put(reinterpret_cast<TX_SEMAPHORE *>(sem));
if (status != TX_SUCCESS) {
- printf("Semaphore put/give, error - %d\n", status);
+ printf("Semaphore put/give, error - %u\n", status);
return -1;
}
@@ -235,7 +235,7 @@ void inferenceProcessThread(ULONG pvParameters) {
// Get the job details from the process queue
tx_status = tx_queue_receive(params.queueHandle, &xJob, TX_WAIT_FOREVER);
if (tx_status != TX_SUCCESS) {
- printf("process failed to receive from Queue, error - %d\n", tx_status);
+ printf("process failed to receive from Queue, error - %u\n", tx_status);
exit(1);
}
@@ -246,14 +246,14 @@ void inferenceProcessThread(ULONG pvParameters) {
// Send response for the job in the response queue
tx_status = tx_queue_send(xJob->responseQueue, &xJob, TX_WAIT_FOREVER);
if (tx_status != TX_SUCCESS) {
- printf("process inferenceProcessThread failed to send to Queue, error - %d\n", tx_status);
+ printf("process inferenceProcessThread failed to send to Queue, error - %u\n", tx_status);
exit(1);
}
}
tx_status = tx_thread_terminate(nullptr);
if (tx_status != TX_SUCCESS) {
- printf("process inferenceProcessThread failed to terminate thread, error - %d\n", tx_status);
+ printf("process inferenceProcessThread failed to terminate thread, error - %u\n", tx_status);
exit(1);
}
}
@@ -271,7 +271,7 @@ void inferenceSenderThread(ULONG pvParameters) {
/* Allocate memory for this inference sender thread responses queue */
status = tx_byte_allocate(&bytePool, reinterpret_cast<VOID **>(&senderQueuePtr), SENDER_QUEUE_SIZE, TX_NO_WAIT);
if (status != TX_SUCCESS) {
- printf("Sender thread failed to allocate bytes for Queue, error - %d\n", status);
+ printf("Sender thread failed to allocate bytes for Queue, error - %u\n", status);
exit(1);
}
@@ -280,7 +280,7 @@ void inferenceSenderThread(ULONG pvParameters) {
&senderQueue, senderQueueName, sizeof(xInferenceJob *) / sizeof(uint32_t), senderQueuePtr, SENDER_QUEUE_SIZE);
if (status != TX_SUCCESS) {
- printf("Sender thread failed to create Queue, error - %d\n", status);
+ printf("Sender thread failed to create Queue, error - %u\n", status);
exit(1);
}
@@ -298,7 +298,7 @@ void inferenceSenderThread(ULONG pvParameters) {
// queue job
status = tx_queue_send(inferenceProcessQueueLocal, &job, TX_WAIT_FOREVER);
if (status != TX_SUCCESS) {
- printf("Sender thread failed to send to Queue, error - %d\n", status);
+ printf("Sender thread failed to send to Queue, error - %u\n", status);
exit(1);
}
}
@@ -309,7 +309,7 @@ void inferenceSenderThread(ULONG pvParameters) {
status = tx_queue_receive(&senderQueue, &pSendJob, TX_WAIT_FOREVER);
if (status != TX_SUCCESS) {
- printf("Sender thread failed to receive from Queue, error - %d\n", status);
+ printf("Sender thread failed to receive from Queue, error - %u\n", status);
exit(1);
}
@@ -323,7 +323,7 @@ void inferenceSenderThread(ULONG pvParameters) {
/* delete the response queue */
status = tx_queue_delete(&senderQueue);
if (status != TX_SUCCESS) {
- printf("Sender thread failed to delete Queue, error - %d\n", status);
+ printf("Sender thread failed to delete Queue, error - %u\n", status);
exit(1);
}
@@ -352,14 +352,14 @@ void tx_application_define(void *first_unused_memory) {
/* Create a byte memory pool from which to allocate the threads stacks and queues. */
status = tx_byte_pool_create(&bytePool, bytePoolName, memoryArea, BYTE_POOL_SIZE);
if (status != TX_SUCCESS) {
- printf("Main failed to allocate pool of bytes, error - %d\n", status);
+ printf("Main failed to allocate pool of bytes, error - %u\n", status);
exit(1);
}
/* Allocate memory for the inference process queue */
status = tx_byte_allocate(&bytePool, reinterpret_cast<VOID **>(&processQueuePtr), PROCESS_QUEUE_SIZE, TX_NO_WAIT);
if (status != TX_SUCCESS) {
- printf("Main failed to allocate bytes for process queue, error - %d\n", status);
+ printf("Main failed to allocate bytes for process queue, error - %u\n", status);
exit(1);
}
@@ -369,7 +369,7 @@ void tx_application_define(void *first_unused_memory) {
processQueuePtr,
PROCESS_QUEUE_SIZE);
if (status != TX_SUCCESS) {
- printf("Main failed to create Queue, error - %d\n", status);
+ printf("Main failed to create Queue, error - %u\n", status);
exit(1);
}
@@ -380,7 +380,7 @@ void tx_application_define(void *first_unused_memory) {
status =
tx_byte_allocate(&bytePool, reinterpret_cast<VOID **>(&senderThreadPtr[n]), sizeof(TX_THREAD), TX_NO_WAIT);
if (status != TX_SUCCESS) {
- printf("Main failed to allocate bytes for sender tread, error - %d\n", status);
+ printf("Main failed to allocate bytes for sender tread, error - %u\n", status);
exit(1);
}
@@ -388,7 +388,7 @@ void tx_application_define(void *first_unused_memory) {
status = tx_byte_allocate(
&bytePool, reinterpret_cast<VOID **>(&senderThreadStackPtr[n]), SENDER_THREAD_STACK_SIZE, TX_NO_WAIT);
if (status != TX_SUCCESS) {
- printf("Main failed to allocate bytes for sender tread stack, error - %d\n", status);
+ printf("Main failed to allocate bytes for sender tread stack, error - %u\n", status);
exit(1);
}
@@ -406,7 +406,7 @@ void tx_application_define(void *first_unused_memory) {
TX_NO_TIME_SLICE,
TX_AUTO_START);
if (status != TX_SUCCESS) {
- printf("Main failed to create Thread, error - %d\n", status);
+ printf("Main failed to create Thread, error - %u\n", status);
exit(1);
}
}
@@ -418,7 +418,7 @@ void tx_application_define(void *first_unused_memory) {
status =
tx_byte_allocate(&bytePool, reinterpret_cast<VOID **>(&processThreadPtr[n]), sizeof(TX_THREAD), TX_NO_WAIT);
if (status != TX_SUCCESS) {
- printf("Main failed to allocate bytes for process tread, error - %d\n", status);
+ printf("Main failed to allocate bytes for process tread, error - %u\n", status);
exit(1);
}
@@ -426,7 +426,7 @@ void tx_application_define(void *first_unused_memory) {
status = tx_byte_allocate(
&bytePool, reinterpret_cast<VOID **>(&processThreadStackPtr[n]), PROCESS_THREAD_STACK_SIZE, TX_NO_WAIT);
if (status != TX_SUCCESS) {
- printf("Main failed to allocate bytes for process stack, error - %d\n", status);
+ printf("Main failed to allocate bytes for process stack, error - %u\n", status);
exit(1);
}
@@ -446,7 +446,7 @@ void tx_application_define(void *first_unused_memory) {
TX_NO_TIME_SLICE,
TX_AUTO_START);
if (status != TX_SUCCESS) {
- printf("Main failed to create thread, error - %d\n", status);
+ printf("Main failed to create thread, error - %u\n", status);
exit(1);
}
}