port.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * FreeModbus Libary: BARE Port
  3. * Copyright (C) 2006 Christian Walter <wolti@sil.at>
  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.1 2007/04/24 23:15:18 wolti Exp $
  20. */
  21. #ifndef _PORT_H
  22. #define _PORT_H
  23. #include <rtthread.h>
  24. #define INLINE
  25. #define PR_BEGIN_EXTERN_C extern "C" {
  26. #define PR_END_EXTERN_C }
  27. #define assert(x) RT_ASSERT(x)
  28. #define ENTER_CRITICAL_SECTION() EnterCriticalSection()
  29. #define EXIT_CRITICAL_SECTION() ExitCriticalSection()
  30. void EnterCriticalSection( void );
  31. void ExitCriticalSection( void );
  32. typedef rt_uint8_t BOOL;
  33. typedef unsigned char UBYTE;
  34. typedef unsigned char UCHAR;
  35. typedef char CHAR;
  36. typedef rt_uint16_t USHORT;
  37. typedef rt_int16_t SHORT;
  38. typedef rt_uint32_t ULONG;
  39. typedef rt_int32_t LONG;
  40. #ifndef TRUE
  41. #define TRUE 1
  42. #endif
  43. #ifndef FALSE
  44. #define FALSE 0
  45. #endif
  46. #endif