Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions threadX/inc/u_tx_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ typedef struct {
TX_THREAD _TX_THREAD;
} thread_t;

/* Creates a thread based on the provided configuration.
*
* @param byte_pool Pointer to the byte pool to allocate the thread's stack from.
* @param thread Pointer to a thread_t struct containing the thread's configuration.
* @return U_SUCCESS if the thread was created successfully, U_ERROR otherwise.
*/
uint8_t create_thread(TX_BYTE_POOL *byte_pool, thread_t *thread);

/**
* Sleeps the current thread for the specified number of milliseconds.
*/
uint8_t thread_sleep_ms(uint32_t ms);

#endif
7 changes: 7 additions & 0 deletions threadX/src/u_tx_threads.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#include "u_tx_threads.h"
#include "u_tx_debug.h"
#include "u_tx_general.h"

// clang-format off

Expand All @@ -27,4 +28,10 @@ uint8_t create_thread(TX_BYTE_POOL *byte_pool, thread_t *thread)
return U_SUCCESS;
}

uint8_t thread_sleep_ms(uint32_t ms)
{
tx_thread_sleep(MS_TO_TICKS(ms));
return U_SUCCESS;
}

// clang-format on
Loading