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