• R/O
  • SSH
  • HTTPS

chibios: 提交


Commit MetaInfo

修订版14625 (tree)
时间2021-07-26 18:31:10
作者vrepetenko

Log Message

Fixed warnings with STATIC_INLINE, modified target core checks.

更改概述

差异

--- trunk/os/hal/ports/STM32/STM32WLxx/hal_lld.c (revision 14624)
+++ trunk/os/hal/ports/STM32/STM32WLxx/hal_lld.c (revision 14625)
@@ -202,13 +202,12 @@
202202 /* Driver local functions. */
203203 /*===========================================================================*/
204204
205-#if (STM32_NO_INIT == FALSE || defined(HAL_LLD_USE_CLOCK_MANAGEMENT)) || defined(__DOXYGEN__)
206205 /**
207206 * @brief Safe setting of flash ACR register.
208207 *
209208 * @param[in] acr value for the ACR register
210209 */
211-static void flash_set_acr(uint32_t acr) {
210+__STATIC_INLINE void flash_set_acr(uint32_t acr) {
212211
213212 FLASH->ACR = acr;
214213 while ((FLASH->ACR & FLASH_ACR_LATENCY_Msk) != (acr & FLASH_ACR_LATENCY_Msk)) {
@@ -215,14 +214,12 @@
215214 /* Waiting for flash wait states setup.*/
216215 }
217216 }
218-#endif /* (STM32_NO_INIT == TRUE || defined(HAL_LLD_USE_CLOCK_MANAGEMENT)) */
219217
220-#if (STM32_NO_INIT == FALSE) || defined(__DOXYGEN__)
221218 /**
222219 * @brief Configures the PWR unit.
223220 * @note CR1, CR2 and CR5 are not initialized inside this function.
224221 */
225-static void hal_lld_set_static_pwr(void) {
222+__STATIC_INLINE void hal_lld_set_static_pwr(void) {
226223
227224 /* Static PWR configurations.*/
228225 PWR->CR3 = STM32_PWR_CR3;
@@ -240,7 +237,7 @@
240237 /**
241238 * @brief Initializes static muxes and dividers.
242239 */
243-static void hal_lld_set_static_clocks(void) {
240+__STATIC_INLINE void hal_lld_set_static_clocks(void) {
244241
245242 uint32_t ccipr;
246243
@@ -258,7 +255,6 @@
258255
259256 RCC->CCIPR = ccipr;
260257 }
261-#endif /* (STM32_NO_INIT == FALSE) */
262258
263259 #if defined(HAL_LLD_USE_CLOCK_MANAGEMENT) || defined(__DOXYGEN__)
264260 static bool hal_lld_check_pll(const system_limits_t *slp,
--- trunk/os/hal/ports/STM32/STM32WLxx/hal_lld.h (revision 14624)
+++ trunk/os/hal/ports/STM32/STM32WLxx/hal_lld.h (revision 14625)
@@ -368,14 +368,6 @@
368368 #endif
369369
370370 /**
371- * @brief Target code for this HAL configuration.
372- * @note Core 1 is the Cortex-M4, core 2 is the Cortex-M0+.
373- */
374-#if !defined(STM32_TARGET_CORE) || defined(__DOXYGEN__)
375-#define STM32_TARGET_CORE 1
376-#endif
377-
378-/**
379371 * @brief Enables the dynamic clock handling.
380372 */
381373 #if !defined(STM32_CLOCK_DYNAMIC) || defined(__DOXYGEN__)
@@ -734,12 +726,11 @@
734726 #error "Using a wrong mcuconf.h file, STM32WLxx_MCUCONF not defined"
735727 #endif
736728
737-/**
738- * @brief Target core for this HAL configuration.
739- * @note Core 1 is the Cortex-M4, core 2 is the Cortex-M0+.
729+/*
730+ * Target core checks.
740731 */
741-#if !defined(STM32_TARGET_CORE) || defined(__DOXYGEN__)
742-#define STM32_TARGET_CORE 1
732+#if !defined(STM32_TARGET_CORE)
733+#error "STM32_TARGET_CORE not defined in mcuconf.h"
743734 #endif
744735
745736 #if (STM32_TARGET_CORE == 2) && (STM32_HAS_M0 == FALSE)
@@ -748,7 +739,7 @@
748739
749740 #if (defined(CORE_CM0PLUS) && (STM32_TARGET_CORE == 1)) || \
750741 (!defined(CORE_CM0PLUS) && (STM32_TARGET_CORE == 2))
751-#error "wrong target core specified"
742+#error "wrong target core specified in mcuconf.h"
752743 #endif
753744
754745 /*
--- trunk/os/hal/ports/STM32/STM32WLxx/stm32_registry.h (revision 14624)
+++ trunk/os/hal/ports/STM32/STM32WLxx/stm32_registry.h (revision 14625)
@@ -200,7 +200,7 @@
200200 #define STM32_RTC_TAMP_STAMP_EXTI 19
201201 #define STM32_RTC_WKUP_EXTI 20
202202
203-#if STM32_TARGET_CORE == 1
203+#if !defined(CORE_CM0PLUS)
204204
205205 #define STM32_RTC_TAMP_STAMP_HANDLER Vector48
206206 #define STM32_RTC_WKUP_HANDLER Vector4C
@@ -221,7 +221,7 @@
221221 #define STM32_RTC_IRQ_ENABLE() \
222222 nvicEnableVector(STM32_RTC_COMMON_NUMBER, STM32_IRQ_EXTI17_20_IRQ_PRIORITY)
223223
224-#endif /* STM32_TARGET_CORE == 1 */
224+#endif /* !defined(CORE_CM0PLUS) */
225225
226226 /* Enabling RTC-related EXTI lines.*/
227227 #define STM32_RTC_ENABLE_ALL_EXTI() do { \
Show on old repository browser