1 /* 2 * FreeModbus Libary: BARE Port 3 * Copyright (C) 2013 Armink <[email protected]> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * 19 * File: $Id: port.h ,v 1.60 2013/08/13 15:07:05 Armink add Master Functions $ 20 */ 21 22 #ifndef _PORT_H 23 #define _PORT_H 24 25 #include "mbconfig.h" 26 #include <rthw.h> 27 #include <rtthread.h> 28 29 #include <assert.h> 30 #include <inttypes.h> 31 32 #define INLINE 33 #define PR_BEGIN_EXTERN_C extern "C" { 34 #define PR_END_EXTERN_C } 35 36 #define ENTER_CRITICAL_SECTION() EnterCriticalSection() 37 #define EXIT_CRITICAL_SECTION() ExitCriticalSection() 38 39 typedef uint8_t BOOL; 40 41 typedef unsigned char UCHAR; 42 typedef char CHAR; 43 44 typedef uint16_t USHORT; 45 typedef int16_t SHORT; 46 47 typedef uint32_t ULONG; 48 typedef int32_t LONG; 49 50 #ifndef TRUE 51 #define TRUE 1 52 #endif 53 54 #ifndef FALSE 55 #define FALSE 0 56 #endif 57 58 void EnterCriticalSection(void); 59 void ExitCriticalSection(void); 60 61 #endif 62