port.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * FreeModbus Libary: BARE Port
  3. * Copyright (C) 2013 Armink <armink.ztl@gmail.com>
  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. #ifndef _PORT_H
  22. #define _PORT_H
  23. #include "mbconfig.h"
  24. #include <rthw.h>
  25. #include <rtthread.h>
  26. #include <assert.h>
  27. #include <inttypes.h>
  28. #define INLINE
  29. #define PR_BEGIN_EXTERN_C extern "C" {
  30. #define PR_END_EXTERN_C }
  31. #define ENTER_CRITICAL_SECTION() EnterCriticalSection()
  32. #define EXIT_CRITICAL_SECTION() ExitCriticalSection()
  33. typedef uint8_t BOOL;
  34. typedef unsigned char UCHAR;
  35. typedef char CHAR;
  36. typedef uint16_t USHORT;
  37. typedef int16_t SHORT;
  38. typedef uint32_t ULONG;
  39. typedef int32_t LONG;
  40. #ifndef TRUE
  41. #define TRUE 1
  42. #endif
  43. #ifndef FALSE
  44. #define FALSE 0
  45. #endif
  46. void EnterCriticalSection(void);
  47. void ExitCriticalSection(void);
  48. #endif