port.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _PORT_H
  2. #define _PORT_H
  3. //#include "main.h"
  4. #include "at32f403a_407.h"
  5. #include "FreeRTOS.h"
  6. #include "task.h"
  7. /* ----------------------- Defines ------------------------------------------*/
  8. #define INLINE inline
  9. #define PR_BEGIN_EXTERN_C extern "C" {
  10. #define PR_END_EXTERN_C }
  11. #define ENTER_CRITICAL_SECTION( ) vMBPortEnterCritical()
  12. #define EXIT_CRITICAL_SECTION( ) vMBPortExitCritical()
  13. #define assert( x )
  14. typedef char BOOL;
  15. typedef unsigned char UCHAR;
  16. typedef char CHAR;
  17. typedef unsigned short USHORT;
  18. typedef short SHORT;
  19. typedef unsigned long ULONG;
  20. typedef long LONG;
  21. //typedef enum {FALSE = 0, TRUE = !FALSE} confirm_state;
  22. /*
  23. #ifndef TRUE
  24. #define TRUE 1
  25. #endif
  26. #ifndef FALSE
  27. #define FALSE 0
  28. #endif
  29. */
  30. #define MB_PORT_HAS_CLOSE 1
  31. #define MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS 2
  32. /* ----------------------- Prototypes ---------------------------------------*/
  33. void vMBPortSetWithinException( BOOL bInException );
  34. BOOL bMBPortIsWithinException( void );
  35. void vMBPortEnterCritical( void );
  36. void vMBPortExitCritical( void );
  37. void vMB_USART_IRQHandler(void);
  38. #endif