mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-20 15:08:37 +03:00
Initial commit
This commit is contained in:
26
external/CMSIS_5/CMSIS/RTOS/RTX/UserCodeTemplates/Thread.c
vendored
Normal file
26
external/CMSIS_5/CMSIS/RTOS/RTX/UserCodeTemplates/Thread.c
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
#include "cmsis_os.h" // CMSIS RTOS header file
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Thread 1 'Thread_Name': Sample thread
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
void Thread (void const *argument); // thread function
|
||||
osThreadId tid_Thread; // thread id
|
||||
osThreadDef (Thread, osPriorityNormal, 1, 0); // thread object
|
||||
|
||||
int Init_Thread (void) {
|
||||
|
||||
tid_Thread = osThreadCreate (osThread(Thread), NULL);
|
||||
if (!tid_Thread) return(-1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void Thread (void const *argument) {
|
||||
|
||||
while (1) {
|
||||
; // Insert thread code here...
|
||||
osThreadYield (); // suspend thread
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user