1 #ifndef __ALT_FLAG_H__ 2 #define __ALT_FLAG_H__ 3 4 /****************************************************************************** 5 * * 6 * License Agreement * 7 * * 8 * Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * 9 * All rights reserved. * 10 * * 11 * Permission is hereby granted, free of charge, to any person obtaining a * 12 * copy of this software and associated documentation files (the "Software"), * 13 * to deal in the Software without restriction, including without limitation * 14 * the rights to use, copy, modify, merge, publish, distribute, sublicense, * 15 * and/or sell copies of the Software, and to permit persons to whom the * 16 * Software is furnished to do so, subject to the following conditions: * 17 * * 18 * The above copyright notice and this permission notice shall be included in * 19 * all copies or substantial portions of the Software. * 20 * * 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * 22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * 23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * 24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * 25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * 26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * 27 * DEALINGS IN THE SOFTWARE. * 28 * * 29 * * 30 * Altera does not recommend, suggest or require that this reference design * 31 * file be used in conjunction or combination with any other product. * 32 ******************************************************************************/ 33 34 /****************************************************************************** 35 * * 36 * THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. * 37 * * 38 ******************************************************************************/ 39 40 /* 41 * This header provides macro definitions that can be used to create and use 42 * uc/OS-II style event flags. These macros can be used in both a uC/OS-II based 43 * environment, and a single threaded HAL based environment. 44 * 45 * The motivation for these macros is to allow code to be developed which is 46 * thread safe under uC/OS-II, but incurs no additional overhead when used in a 47 * single threaded HAL environment. 48 * 49 * In the case of a single threaded HAL environment, they compile to 50 * "do nothing" directives, which ensures they do not contribute to the final 51 * executable. 52 * 53 * The following macros are available: 54 * 55 * ALT_FLAG_GRP - Create a flag group instance. 56 * ALT_EXTERN_FLAG_GRP - Create a reference to an external flag group instance. 57 * ALT_STATIC_FLAG_GRP - Create a static flag group instance. 58 * ALT_FLAG_CREATE - Initialise a flag group. 59 * ALT_FLAG_PEND - Pend on a flag group. 60 * ALT_FLAG_POST - Set a flag condition. 61 62 * 63 * Input arguments and return codes are all consistant with the equivalent 64 * uC/OS-II function. 65 * 66 * It's important to be careful in the use of the macros: ALT_FLAG_GRP, 67 * ALT_EXTERN_FLAG_GRP, and ALT_STATIC_FLAG_GRP. In these three cases the 68 * semi-colon is included in the macro definition; so, for example, you should 69 * use: 70 * 71 * ALT_FLAG_GRP(mygroup) 72 * 73 * not: 74 * 75 * ALT_FLAG_GRP(mygroup); 76 * 77 * The inclusion of the semi-colon has been necessary to ensure the macros can 78 * compile with no warnings when used in a single threaded HAL environment. 79 * 80 */ 81 82 #include "priv/alt_no_error.h" 83 84 #define ALT_FLAG_GRP(group) 85 #define ALT_EXTERN_FLAG_GRP(group) 86 #define ALT_STATIC_FLAG_GRP(group) 87 88 #define ALT_FLAG_CREATE(group, flags) alt_no_error () 89 #define ALT_FLAG_PEND(group, flags, wait_type, timeout) alt_no_error () 90 #define ALT_FLAG_POST(group, flags, opt) alt_no_error () 91 92 #ifndef ALT_SINGLE_THREADED 93 #define ALT_SINGLE_THREADED 94 #endif 95 96 #endif /* __ALT_FLAG_H__ */ 97