Tom Martins
/
Probleme_implementation_lwip2
test public
Fork of Probleme_implementation_lwip by
port.h@1:a3ee8cb24540, 2018-07-02 (annotated)
- Committer:
- TomTom83
- Date:
- Mon Jul 02 14:36:46 2018 +0000
- Revision:
- 1:a3ee8cb24540
- Parent:
- 0:0453a0a7e500
adaptation de bafian modbus
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cam | 0:0453a0a7e500 | 1 | /* |
cam | 0:0453a0a7e500 | 2 | * FreeModbus Libary: BARE Port |
cam | 0:0453a0a7e500 | 3 | * Copyright (C) 2006 Christian Walter <wolti@sil.at> |
cam | 0:0453a0a7e500 | 4 | * |
cam | 0:0453a0a7e500 | 5 | * This library is free software; you can redistribute it and/or |
cam | 0:0453a0a7e500 | 6 | * modify it under the terms of the GNU Lesser General Public |
cam | 0:0453a0a7e500 | 7 | * License as published by the Free Software Foundation; either |
cam | 0:0453a0a7e500 | 8 | * version 2.1 of the License, or (at your option) any later version. |
cam | 0:0453a0a7e500 | 9 | * |
cam | 0:0453a0a7e500 | 10 | * This library is distributed in the hope that it will be useful, |
cam | 0:0453a0a7e500 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
cam | 0:0453a0a7e500 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
cam | 0:0453a0a7e500 | 13 | * Lesser General Public License for more details. |
cam | 0:0453a0a7e500 | 14 | * |
cam | 0:0453a0a7e500 | 15 | * You should have received a copy of the GNU Lesser General Public |
cam | 0:0453a0a7e500 | 16 | * License along with this library; if not, write to the Free Software |
cam | 0:0453a0a7e500 | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
cam | 0:0453a0a7e500 | 18 | * |
cam | 0:0453a0a7e500 | 19 | * File: $Id: port.h,v 1.1 2006/08/22 21:35:13 wolti Exp $ |
cam | 0:0453a0a7e500 | 20 | */ |
cam | 0:0453a0a7e500 | 21 | |
cam | 0:0453a0a7e500 | 22 | #ifndef _PORT_H |
cam | 0:0453a0a7e500 | 23 | #define _PORT_H |
cam | 0:0453a0a7e500 | 24 | |
cam | 0:0453a0a7e500 | 25 | #include <assert.h> |
cam | 0:0453a0a7e500 | 26 | #include <inttypes.h> |
cam | 0:0453a0a7e500 | 27 | |
cam | 0:0453a0a7e500 | 28 | #define INLINE //inline |
cam | 0:0453a0a7e500 | 29 | #define PR_BEGIN_EXTERN_C //extern "C" { |
cam | 0:0453a0a7e500 | 30 | #define PR_END_EXTERN_C //} |
cam | 0:0453a0a7e500 | 31 | |
cam | 0:0453a0a7e500 | 32 | #define ENTER_CRITICAL_SECTION( ) |
cam | 0:0453a0a7e500 | 33 | #define EXIT_CRITICAL_SECTION( ) |
cam | 0:0453a0a7e500 | 34 | |
cam | 0:0453a0a7e500 | 35 | typedef uint8_t BOOL; |
cam | 0:0453a0a7e500 | 36 | |
cam | 0:0453a0a7e500 | 37 | typedef unsigned char UCHAR; |
cam | 0:0453a0a7e500 | 38 | typedef char CHAR; |
cam | 0:0453a0a7e500 | 39 | |
cam | 0:0453a0a7e500 | 40 | typedef uint16_t USHORT; |
cam | 0:0453a0a7e500 | 41 | typedef int16_t SHORT; |
cam | 0:0453a0a7e500 | 42 | |
cam | 0:0453a0a7e500 | 43 | typedef uint32_t ULONG; |
cam | 0:0453a0a7e500 | 44 | typedef int32_t LONG; |
cam | 0:0453a0a7e500 | 45 | |
cam | 0:0453a0a7e500 | 46 | #ifndef TRUE |
cam | 0:0453a0a7e500 | 47 | #define TRUE 1 |
cam | 0:0453a0a7e500 | 48 | #endif |
cam | 0:0453a0a7e500 | 49 | |
cam | 0:0453a0a7e500 | 50 | #ifndef FALSE |
cam | 0:0453a0a7e500 | 51 | #define FALSE 0 |
cam | 0:0453a0a7e500 | 52 | #endif |
cam | 0:0453a0a7e500 | 53 | |
TomTom83 | 1:a3ee8cb24540 | 54 | #define MB_TCP_DEBUG 1 |
TomTom83 | 1:a3ee8cb24540 | 55 | |
TomTom83 | 1:a3ee8cb24540 | 56 | #ifdef MB_TCP_DEBUG |
TomTom83 | 1:a3ee8cb24540 | 57 | typedef enum |
TomTom83 | 1:a3ee8cb24540 | 58 | { |
TomTom83 | 1:a3ee8cb24540 | 59 | MB_LOG_DEBUG, |
TomTom83 | 1:a3ee8cb24540 | 60 | MB_LOG_INFO, |
TomTom83 | 1:a3ee8cb24540 | 61 | MB_LOG_WARN, |
TomTom83 | 1:a3ee8cb24540 | 62 | MB_LOG_ERROR |
TomTom83 | 1:a3ee8cb24540 | 63 | } eMBPortLogLevel; |
cam | 0:0453a0a7e500 | 64 | #endif |
TomTom83 | 1:a3ee8cb24540 | 65 | |
TomTom83 | 1:a3ee8cb24540 | 66 | /* ----------------------- Function prototypes ------------------------------*/ |
TomTom83 | 1:a3ee8cb24540 | 67 | #ifdef MB_TCP_DEBUG |
TomTom83 | 1:a3ee8cb24540 | 68 | void vMBPortLog( eMBPortLogLevel eLevel, const CHAR * szModule, |
TomTom83 | 1:a3ee8cb24540 | 69 | const CHAR * szFmt, ... ); |
TomTom83 | 1:a3ee8cb24540 | 70 | void prvvMBTCPLogFrame( UCHAR * pucMsg, UCHAR * pucFrame, USHORT usFrameLen ); |
TomTom83 | 1:a3ee8cb24540 | 71 | #endif |
TomTom83 | 1:a3ee8cb24540 | 72 | |
TomTom83 | 1:a3ee8cb24540 | 73 | #endif |