SAM4S-EK_FreeRTOS+FAT-SL
1.0
An example project to test the functionality of FreeRTOS+FAT-SL using SD card as data storage medium
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
semphr.h
Go to the documentation of this file.
1
/*
2
FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd.
3
All rights reserved
4
5
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6
7
***************************************************************************
8
* *
9
* FreeRTOS provides completely free yet professionally developed, *
10
* robust, strictly quality controlled, supported, and cross *
11
* platform software that has become a de facto standard. *
12
* *
13
* Help yourself get started quickly and support the FreeRTOS *
14
* project by purchasing a FreeRTOS tutorial book, reference *
15
* manual, or both from: http://www.FreeRTOS.org/Documentation *
16
* *
17
* Thank you! *
18
* *
19
***************************************************************************
20
21
This file is part of the FreeRTOS distribution.
22
23
FreeRTOS is free software; you can redistribute it and/or modify it under
24
the terms of the GNU General Public License (version 2) as published by the
25
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
26
27
>>! NOTE: The modification to the GPL is included to allow you to !<<
28
>>! distribute a combined work that includes FreeRTOS without being !<<
29
>>! obliged to provide the source code for proprietary components !<<
30
>>! outside of the FreeRTOS kernel. !<<
31
32
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
33
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
34
FOR A PARTICULAR PURPOSE. Full license text is available from the following
35
link: http://www.freertos.org/a00114.html
36
37
1 tab == 4 spaces!
38
39
***************************************************************************
40
* *
41
* Having a problem? Start by reading the FAQ "My application does *
42
* not run, what could be wrong?" *
43
* *
44
* http://www.FreeRTOS.org/FAQHelp.html *
45
* *
46
***************************************************************************
47
48
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
49
license and Real Time Engineers Ltd. contact details.
50
51
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
52
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
53
compatible FAT file system, and our tiny thread aware UDP/IP stack.
54
55
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
56
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
57
licenses offer ticketed support, indemnification and middleware.
58
59
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
60
engineered and independently SIL3 certified version for use in safety and
61
mission critical applications that require provable dependability.
62
63
1 tab == 4 spaces!
64
*/
65
66
#ifndef SEMAPHORE_H
67
#define SEMAPHORE_H
68
69
#ifndef INC_FREERTOS_H
70
#error "include FreeRTOS.h" must appear in source files before "include semphr.h"
71
#endif
72
73
#include "
queue.h
"
74
75
typedef
QueueHandle_t
SemaphoreHandle_t
;
76
77
#define semBINARY_SEMAPHORE_QUEUE_LENGTH ( ( uint8_t ) 1U )
78
#define semSEMAPHORE_QUEUE_ITEM_LENGTH ( ( uint8_t ) 0U )
79
#define semGIVE_BLOCK_TIME ( ( TickType_t ) 0U )
80
81
127
#define vSemaphoreCreateBinary( xSemaphore ) \
128
{ \
129
( xSemaphore ) = xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE ); \
130
if( ( xSemaphore ) != NULL ) \
131
{ \
132
( void ) xSemaphoreGive( ( xSemaphore ) ); \
133
} \
134
}
135
181
#define xSemaphoreCreateBinary() xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE )
182
248
#define xSemaphoreTake( xSemaphore, xBlockTime ) xQueueGenericReceive( ( QueueHandle_t ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE )
249
341
#define xSemaphoreTakeRecursive( xMutex, xBlockTime ) xQueueTakeMutexRecursive( ( xMutex ), ( xBlockTime ) )
342
343
344
/*
345
* xSemaphoreAltTake() is an alternative version of xSemaphoreTake().
346
*
347
* The source code that implements the alternative (Alt) API is much
348
* simpler because it executes everything from within a critical section.
349
* This is the approach taken by many other RTOSes, but FreeRTOS.org has the
350
* preferred fully featured API too. The fully featured API has more
351
* complex code that takes longer to execute, but makes much less use of
352
* critical sections. Therefore the alternative API sacrifices interrupt
353
* responsiveness to gain execution speed, whereas the fully featured API
354
* sacrifices execution speed to ensure better interrupt responsiveness.
355
*/
356
#define xSemaphoreAltTake( xSemaphore, xBlockTime ) xQueueAltGenericReceive( ( QueueHandle_t ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE )
357
419
#define xSemaphoreGive( xSemaphore ) xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
420
503
#define xSemaphoreGiveRecursive( xMutex ) xQueueGiveMutexRecursive( ( xMutex ) )
504
505
/*
506
* xSemaphoreAltGive() is an alternative version of xSemaphoreGive().
507
*
508
* The source code that implements the alternative (Alt) API is much
509
* simpler because it executes everything from within a critical section.
510
* This is the approach taken by many other RTOSes, but FreeRTOS.org has the
511
* preferred fully featured API too. The fully featured API has more
512
* complex code that takes longer to execute, but makes much less use of
513
* critical sections. Therefore the alternative API sacrifices interrupt
514
* responsiveness to gain execution speed, whereas the fully featured API
515
* sacrifices execution speed to ensure better interrupt responsiveness.
516
*/
517
#define xSemaphoreAltGive( xSemaphore ) xQueueAltGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
518
608
#define xSemaphoreGiveFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
609
642
#define xSemaphoreTakeFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueReceiveFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ) )
643
689
#define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX )
690
691
744
#define xSemaphoreCreateRecursiveMutex() xQueueCreateMutex( queueQUEUE_TYPE_RECURSIVE_MUTEX )
745
807
#define xSemaphoreCreateCounting( uxMaxCount, uxInitialCount ) xQueueCreateCountingSemaphore( ( uxMaxCount ), ( uxInitialCount ) )
808
821
#define vSemaphoreDelete( xSemaphore ) vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) )
822
836
#define xSemaphoreGetMutexHolder( xSemaphore ) xQueueGetMutexHolder( ( xSemaphore ) )
837
838
#endif
/* SEMAPHORE_H */
839
840
queue.h
QueueHandle_t
void * QueueHandle_t
Definition:
queue.h:84
SemaphoreHandle_t
QueueHandle_t SemaphoreHandle_t
Definition:
semphr.h:75
cmsis
src
freertos
freertos-v8.0.1
source
include
semphr.h
Generated on Thu Oct 16 2014 15:19:16 for SAM4S-EK_FreeRTOS+FAT-SL by
1.8.8