2121 ******************************************************************************
2222 * @attention
2323 *
24- * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
24+ * <h2><center>© Copyright (c) 2017 STMicroelectronics.
25+ * All rights reserved.</center></h2>
2526 *
26- * Redistribution and use in source and binary forms, with or without modification,
27- * are permitted provided that the following conditions are met:
28- * 1. Redistributions of source code must retain the above copyright notice,
29- * this list of conditions and the following disclaimer.
30- * 2. Redistributions in binary form must reproduce the above copyright notice,
31- * this list of conditions and the following disclaimer in the documentation
32- * and/or other materials provided with the distribution.
33- * 3. Neither the name of STMicroelectronics nor the names of its contributors
34- * may be used to endorse or promote products derived from this software
35- * without specific prior written permission.
36- *
37- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+ * This software component is licensed by ST under BSD 3-Clause license,
28+ * the "License"; You may not use this file except in compliance with the
29+ * License. You may obtain a copy of the License at:
30+ * opensource.org/licenses/BSD-3-Clause
4731 *
4832 ******************************************************************************
4933 */
6650 * @{
6751 */
6852/**
69- * @brief STM32F4xx HAL Driver version number V1.7.3
53+ * @brief STM32F4xx HAL Driver version number V1.7.8
7054 */
7155#define __STM32F4xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
7256#define __STM32F4xx_HAL_VERSION_SUB1 (0x07U) /*!< [23:16] sub1 version */
73- #define __STM32F4xx_HAL_VERSION_SUB2 (0x03U ) /*!< [15:8] sub2 version */
57+ #define __STM32F4xx_HAL_VERSION_SUB2 (0x08U ) /*!< [15:8] sub2 version */
7458#define __STM32F4xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
7559#define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24U)\
7660 |(__STM32F4xx_HAL_VERSION_SUB1 << 16U)\
@@ -357,14 +341,26 @@ uint32_t HAL_GetTickPrio(void)
357341HAL_StatusTypeDef HAL_SetTickFreq (HAL_TickFreqTypeDef Freq )
358342{
359343 HAL_StatusTypeDef status = HAL_OK ;
344+ HAL_TickFreqTypeDef prevTickFreq ;
345+
360346 assert_param (IS_TICKFREQ (Freq ));
361347
362348 if (uwTickFreq != Freq )
363349 {
350+ /* Back up uwTickFreq frequency */
351+ prevTickFreq = uwTickFreq ;
352+
353+ /* Update uwTickFreq global variable used by HAL_InitTick() */
364354 uwTickFreq = Freq ;
365355
366356 /* Apply the new tick Freq */
367357 status = HAL_InitTick (uwTickPrio );
358+
359+ if (status != HAL_OK )
360+ {
361+ /* Restore previous tick frequency */
362+ uwTickFreq = prevTickFreq ;
363+ }
368364 }
369365
370366 return status ;
@@ -542,23 +538,38 @@ void HAL_DisableCompensationCell(void)
542538}
543539
544540/**
545- * @brief Return the unique device identifier (UID based on 96 bits)
546- * @param UID pointer to 3 words array.
541+ * @brief Returns first word of the unique device identifier (UID based on 96 bits)
542+ * @retval Device identifier
543+ */
544+ uint32_t HAL_GetUIDw0 (void )
545+ {
546+ return (READ_REG (* ((uint32_t * )UID_BASE )));
547+ }
548+
549+ /**
550+ * @brief Returns second word of the unique device identifier (UID based on 96 bits)
551+ * @retval Device identifier
552+ */
553+ uint32_t HAL_GetUIDw1 (void )
554+ {
555+ return (READ_REG (* ((uint32_t * )(UID_BASE + 4U ))));
556+ }
557+
558+ /**
559+ * @brief Returns third word of the unique device identifier (UID based on 96 bits)
547560 * @retval Device identifier
548561 */
549- void HAL_GetUID ( uint32_t * UID )
562+ uint32_t HAL_GetUIDw2 ( void )
550563{
551- UID [0 ] = (uint32_t )(READ_REG (* ((uint32_t * )UID_BASE )));
552- UID [1 ] = (uint32_t )(READ_REG (* ((uint32_t * )(UID_BASE + 4U ))));
553- UID [2 ] = (uint32_t )(READ_REG (* ((uint32_t * )(UID_BASE + 8U ))));
564+ return (READ_REG (* ((uint32_t * )(UID_BASE + 8U ))));
554565}
555566
556567#if defined(STM32F427xx ) || defined(STM32F437xx ) || defined(STM32F429xx )|| defined(STM32F439xx ) || \
557568 defined(STM32F469xx ) || defined(STM32F479xx )
558569/**
559570 * @brief Enables the Internal FLASH Bank Swapping.
560571 *
561- * @note This function can be used only for STM32F42xxx/43xxx devices.
572+ * @note This function can be used only for STM32F42xxx/43xxx/469xx/479xx devices.
562573 *
563574 * @note Flash Bank2 mapped at 0x08000000 (and aliased @0x00000000)
564575 * and Flash Bank1 mapped at 0x08100000 (and aliased at 0x00100000)
@@ -573,7 +584,7 @@ void HAL_EnableMemorySwappingBank(void)
573584/**
574585 * @brief Disables the Internal FLASH Bank Swapping.
575586 *
576- * @note This function can be used only for STM32F42xxx/43xxx devices.
587+ * @note This function can be used only for STM32F42xxx/43xxx/469xx/479xx devices.
577588 *
578589 * @note The default state : Flash Bank1 mapped at 0x08000000 (and aliased @0x00000000)
579590 * and Flash Bank2 mapped at 0x08100000 (and aliased at 0x00100000)
0 commit comments