]> mj.ucw.cz Git - home-hw.git/blob - nucleo-test/Inc/stm32_assert.h
f82b038ffd1a2e7d9c260ba1140e6e955973a709
[home-hw.git] / nucleo-test / Inc / stm32_assert.h
1 /**\r
2   ******************************************************************************\r
3   * @file    stm32_assert.h\r
4   * @brief   STM32 assert file.\r
5   ******************************************************************************\r
6    ** This notice applies to any and all portions of this file\r
7   * that are not between comment pairs USER CODE BEGIN and\r
8   * USER CODE END. Other portions of this file, whether \r
9   * inserted by the user or by software development tools\r
10   * are owned by their respective copyright owners.\r
11   *\r
12   * COPYRIGHT(c) 2018 STMicroelectronics\r
13   *\r
14   * Redistribution and use in source and binary forms, with or without modification,\r
15   * are permitted provided that the following conditions are met:\r
16   *   1. Redistributions of source code must retain the above copyright notice,\r
17   *      this list of conditions and the following disclaimer.\r
18   *   2. Redistributions in binary form must reproduce the above copyright notice,\r
19   *      this list of conditions and the following disclaimer in the documentation\r
20   *      and/or other materials provided with the distribution.\r
21   *   3. Neither the name of STMicroelectronics nor the names of its contributors\r
22   *      may be used to endorse or promote products derived from this software\r
23   *      without specific prior written permission.\r
24   *\r
25   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
26   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
27   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
28   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
29   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
30   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
31   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
32   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
33   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
34   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
35   *\r
36   ******************************************************************************\r
37   */\r
38 \r
39 /* Define to prevent recursive inclusion -------------------------------------*/\r
40 #ifndef __STM32_ASSERT_H\r
41 #define __STM32_ASSERT_H\r
42 \r
43 #ifdef __cplusplus\r
44  extern "C" {\r
45 #endif\r
46 \r
47 /* Exported types ------------------------------------------------------------*/\r
48 /* Exported constants --------------------------------------------------------*/\r
49 /* Includes ------------------------------------------------------------------*/\r
50 /* Exported macro ------------------------------------------------------------*/\r
51 #ifdef  USE_FULL_ASSERT\r
52 /**\r
53   * @brief  The assert_param macro is used for function's parameters check.\r
54   * @param  expr: If expr is false, it calls assert_failed function\r
55   *         which reports the name of the source file and the source\r
56   *         line number of the call that failed.\r
57   *         If expr is true, it returns no value.\r
58   * @retval None\r
59   */\r
60   #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))\r
61 /* Exported functions ------------------------------------------------------- */\r
62   void assert_failed(uint8_t* file, uint32_t line);\r
63 #else\r
64   #define assert_param(expr) ((void)0U)\r
65 #endif /* USE_FULL_ASSERT */\r
66 \r
67 #ifdef __cplusplus\r
68 }\r
69 #endif\r
70 \r
71 #endif /* __STM32_ASSERT_H */\r
72 \r
73 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r