1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
35
40
45
50
57
58
59
60
61
62
63
64
65
66
67
74
75
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* ... */
#ifndef __APP_THREADX_H__
#define __APP_THREADX_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "main.h"
#include "cmsis_os2.h"
Private includes
Exported types
Exported constants
Exported macro
uint32_t App_TX_CmsisRTOS_Init(void);
Exported functions prototypes
#define USE_TX_MUTEX
#if defined(USE_TX_MUTEX) && defined(USE_TX_SEMAPHORE)
#error "Only one synchronization API must be enabled"
#endif
#ifdef USE_TX_MUTEX
#define APP_SYNC_TYPE osMutexId_t
#define APP_SYNC_GET osMutexAcquire
#define APP_SYNC_PUT osMutexRelease
#define APP_SYNC_CREATE() osMutexNew(NULL)
/* ... */
#else
#define APP_SYNC_TYPE osSemaphoreId_t
#define APP_SYNC_GET osSemaphoreAcquire
#define APP_SYNC_PUT osSemaphoreRelease
#define APP_SYNC_CREATE() osSemaphoreNew(0, 1, NULL)
/* ... */#endif
#define DEFAULT_WAIT_TIME 5
#define APP_THREAD_STACK_SIZE 512
#ifdef __cplusplus
}extern "C" { ... }
#endif/* ... */
#endif