projdefs.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 PROJDEFS_H
  29. #define PROJDEFS_H
  30. /*
  31. * Defines the prototype to which task functions must conform. Defined in this
  32. * file to ensure the type is known before portable.h is included.
  33. */
  34. typedef void (* TaskFunction_t)( void * );
  35. /* Converts a time in milliseconds to a time in ticks. This macro can be
  36. * overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
  37. * definition here is not suitable for your application. */
  38. #ifndef pdMS_TO_TICKS
  39. #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) rt_tick_from_millisecond( (rt_int32_t) xTimeInMs ) )
  40. #endif
  41. #ifndef pdTICKS_TO_MS
  42. #define pdTICKS_TO_MS( xTicks ) ( ( uint32_t ) ( xTicks ) * 1000 / configTICK_RATE_HZ )
  43. #endif
  44. #define pdFALSE ( ( BaseType_t ) 0 )
  45. #define pdTRUE ( ( BaseType_t ) 1 )
  46. #define pdPASS ( pdTRUE )
  47. #define pdFAIL ( pdFALSE )
  48. #define errQUEUE_EMPTY ( ( BaseType_t ) 0 )
  49. #define errQUEUE_FULL ( ( BaseType_t ) 0 )
  50. /* FreeRTOS error definitions. */
  51. #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
  52. #define errQUEUE_BLOCKED ( -4 )
  53. #define errQUEUE_YIELD ( -5 )
  54. #endif /* PROJDEFS_H */