-
Notifications
You must be signed in to change notification settings - Fork 0
/
osObjects.h
70 lines (51 loc) · 2.36 KB
/
osObjects.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*----------------------------------------------------------------------------
* osObjects.h: CMSIS-RTOS global object definitions for an application
*----------------------------------------------------------------------------
*
* This header file defines global RTOS objects used throughout a project
*
* #define osObjectsPublic indicates that objects are defined; without that
* definition the objects are defined as external symbols.
*
*--------------------------------------------------------------------------*/
#ifndef __osObjects
#define __osObjects
#if (!defined (osObjectsPublic))
#define osObjectsExternal // define RTOS objects with extern attribute
#endif
#include <cmsis_os.h> // CMSIS RTOS header file
// global 'thread' functions ---------------------------------------------------
/*
Example:
extern void sample_name (void const *argument); // thread function
osThreadId tid_sample_name; // thread id
osThreadDef (sample_name, osPriorityNormal, 1, 0); // thread object
*/
// global 'semaphores' ----------------------------------------------------------
/*
Example:
osSemaphoreId sid_sample_name; // semaphore id
osSemaphoreDef (sample_name); // semaphore object
*/
// global 'memory pools' --------------------------------------------------------
/*
Example:
typedef struct sample_name type_sample_name; // object data type
osPoolId mpid_sample_name; // memory pool id
osPoolDef (sample_name, 16, type_sample_name); // memory pool object
*/
// global 'message queues' -------------------------------------------------------
/*
Example:
typedef struct sample_name type_sample_name; // object data type
osMessageQId mid_sample_name; // message queue id
osMessageQDef (sample_name, 16, type_sample_name); // message queue object
*/
// global 'mail queues' ----------------------------------------------------------
/*
Example:
typedef struct sample_name type_sample_name; // object data type
osMailQId qid_sample_name; // mail queue id
osMailQDef (sample_name, 16, type_sample_name); // mail queue object
*/
#endif // __osObjects