utilities_conf.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * File Name : utilities_conf.h
  5. * Description : Configuration file for STM32 Utilities.
  6. *
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under BSD 3-Clause license,
  14. * the "License"; You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef UTILITIES_CONF_H
  23. #define UTILITIES_CONF_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #include "cmsis_compiler.h"
  28. #include "string.h"
  29. /******************************************************************************
  30. * common
  31. ******************************************************************************/
  32. #define UTILS_ENTER_CRITICAL_SECTION() \
  33. uint32_t primask_bit = __get_PRIMASK(); \
  34. __disable_irq()
  35. #define UTILS_EXIT_CRITICAL_SECTION() __set_PRIMASK(primask_bit)
  36. #define UTILS_MEMSET8(dest, value, size) memset(dest, value, size);
  37. /******************************************************************************
  38. * tiny low power manager
  39. * (any macro that does not need to be modified can be removed)
  40. ******************************************************************************/
  41. #define UTIL_LPM_INIT_CRITICAL_SECTION()
  42. #define UTIL_LPM_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION()
  43. #define UTIL_LPM_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION()
  44. /******************************************************************************
  45. * sequencer
  46. * (any macro that does not need to be modified can be removed)
  47. ******************************************************************************/
  48. #define UTIL_SEQ_INIT_CRITICAL_SECTION()
  49. #define UTIL_SEQ_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION()
  50. #define UTIL_SEQ_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION()
  51. #define UTIL_SEQ_CONF_TASK_NBR (32)
  52. #define UTIL_SEQ_CONF_PRIO_NBR (2)
  53. #define UTIL_SEQ_MEMSET8(dest, value, size) UTILS_MEMSET8(dest, value, size)
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /*UTILITIES_CONF_H */
  58. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/