portmacro.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * FreeRTOS Kernel V10.4.6
  3. * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * SPDX-License-Identifier: MIT
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  8. * this software and associated documentation files (the "Software"), to deal in
  9. * the Software without restriction, including without limitation the rights to
  10. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  11. * the Software, and to permit persons to whom the Software is furnished to do so,
  12. * subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in all
  15. * copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  19. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  20. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  21. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * https://www.FreeRTOS.org
  25. * https://github.com/FreeRTOS
  26. *
  27. */
  28. #ifndef PORTMACRO_H
  29. #define PORTMACRO_H
  30. #if configUSE_PREEMPTION == 0
  31. void vTimer2ISR( void ) interrupt 5;
  32. #else
  33. void vTimer2ISR( void ) interrupt 5 _naked;
  34. #endif
  35. void vSerialISR( void ) interrupt 4;
  36. /*-----------------------------------------------------------
  37. * Port specific definitions.
  38. *
  39. * The settings in this file configure FreeRTOS correctly for the
  40. * given hardware and compiler.
  41. *
  42. * These settings should not be altered.
  43. *-----------------------------------------------------------
  44. */
  45. /* Type definitions. */
  46. #define portCHAR char
  47. #define portFLOAT float
  48. #define portDOUBLE float
  49. #define portLONG long
  50. #define portSHORT short
  51. #define portSTACK_TYPE uint8_t
  52. #define portBASE_TYPE char
  53. typedef portSTACK_TYPE StackType_t;
  54. typedef signed char BaseType_t;
  55. typedef unsigned char UBaseType_t;
  56. #if( configUSE_16_BIT_TICKS == 1 )
  57. typedef uint16_t TickType_t;
  58. #define portMAX_DELAY ( TickType_t ) 0xffff
  59. #else
  60. typedef uint32_t TickType_t;
  61. #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
  62. #endif
  63. /*-----------------------------------------------------------*/
  64. /* Critical section management. */
  65. #define portENTER_CRITICAL() _asm \
  66. push ACC \
  67. push IE \
  68. _endasm; \
  69. EA = 0;
  70. #define portEXIT_CRITICAL() _asm \
  71. pop ACC \
  72. _endasm; \
  73. ACC &= 0x80; \
  74. IE |= ACC; \
  75. _asm \
  76. pop ACC \
  77. _endasm;
  78. #define portDISABLE_INTERRUPTS() EA = 0;
  79. #define portENABLE_INTERRUPTS() EA = 1;
  80. /*-----------------------------------------------------------*/
  81. /* Hardware specifics. */
  82. #define portBYTE_ALIGNMENT 1
  83. #define portSTACK_GROWTH ( 1 )
  84. #define portTICK_PERIOD_MS ( ( uint32_t ) 1000 / configTICK_RATE_HZ )
  85. /*-----------------------------------------------------------*/
  86. /* Task utilities. */
  87. void vPortYield( void ) _naked;
  88. #define portYIELD() vPortYield();
  89. /*-----------------------------------------------------------*/
  90. #define portNOP() _asm \
  91. nop \
  92. _endasm;
  93. /*-----------------------------------------------------------*/
  94. /* Task function macros as described on the FreeRTOS.org WEB site. */
  95. #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
  96. #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
  97. #endif /* PORTMACRO_H */