Skip to content

Commit b37099d

Browse files
committed
Fix last compiler warning
Fix stm32duino#44 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 3b5cf9d commit b37099d

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

cores/arduino/stm32/analog.c

+2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@
9393
#error "ADC_CLOCK_DIV could not be defined"
9494
#endif
9595

96+
#ifndef ADC_REGULAR_RANK_1
9697
#define ADC_REGULAR_RANK_1 1
98+
#endif
9799
/**
98100
* @}
99101
*/

cores/arduino/stm32/hal_uart_emul.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,15 +369,15 @@ typedef struct
369369
* @param None
370370
* @retval None
371371
*/
372-
#define __UART_EMUL_CLK_ENABLE() __TIM1_CLK_ENABLE();\
372+
#define __UART_EMUL_CLK_ENABLE() __HAL_RCC_TIM1_CLK_ENABLE();\
373373
__HAL_RCC_DMA2_CLK_ENABLE();
374374

375375
/** @brief Disable the clock for UART Emulation.
376376
* clock in the peripherique used in this emulation Timer and DMA
377377
* @param None
378378
* @retval None
379379
*/
380-
#define __UART_EMUL_CLK_DISABLE() __TIM1_CLK_DISABLE();\
380+
#define __UART_EMUL_CLK_DISABLE() __HAL_RCC_TIM1_CLK_DISABLE();\
381381
__HAL_RCC_DMA2_CLK_DISABLE();
382382

383383

cores/arduino/stm32/spi_com.c

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ uint32_t spi_getClkFreqInst(SPI_TypeDef * spi_inst)
111111
uint32_t spi_freq = SystemCoreClock;
112112

113113
#ifdef STM32F0xx
114+
UNUSED(spi_inst);
114115
/* SPIx source CLK is PCKL1 */
115116
spi_freq = HAL_RCC_GetPCLK1Freq();
116117
#else

cores/arduino/stm32/stm32_def.h

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
#include "stm32f4xx.h"
3737
#elif defined(STM32F7xx)
3838
#include "stm32f7xx.h"
39+
// On other HAL series, stm32[fl]yxx.h include
40+
// stm32[fl]yxx_hal.h which include stm32[fl]yxx_hal_conf.h
41+
// For F7, stm32f7xx_hal.h replaced by stm32f7xx_hal_conf.h
42+
#include "stm32f7xx_hal.h"
3943
#elif defined(STM32L0xx)
4044
#include "stm32l0xx.h"
4145
#elif defined(STM32L1xx)

cores/arduino/stm32/uart.c

+24-24
Original file line numberDiff line numberDiff line change
@@ -254,55 +254,55 @@ void uart_deinit(serial_t *obj)
254254
// Reset UART and disable clock
255255
switch (obj->index) {
256256
case 0:
257-
__USART1_FORCE_RESET();
258-
__USART1_RELEASE_RESET();
259-
__USART1_CLK_DISABLE();
257+
__HAL_RCC_USART1_FORCE_RESET();
258+
__HAL_RCC_USART1_RELEASE_RESET();
259+
__HAL_RCC_USART1_CLK_DISABLE();
260260
break;
261261
case 1:
262-
__USART2_FORCE_RESET();
263-
__USART2_RELEASE_RESET();
264-
__USART2_CLK_DISABLE();
262+
__HAL_RCC_USART2_FORCE_RESET();
263+
__HAL_RCC_USART2_RELEASE_RESET();
264+
__HAL_RCC_USART2_CLK_DISABLE();
265265
break;
266266
#if defined(USART3_BASE)
267267
case 2:
268-
__USART3_FORCE_RESET();
269-
__USART3_RELEASE_RESET();
270-
__USART3_CLK_DISABLE();
268+
__HAL_RCC_USART3_FORCE_RESET();
269+
__HAL_RCC_USART3_RELEASE_RESET();
270+
__HAL_RCC_USART3_CLK_DISABLE();
271271
break;
272272
#endif
273273
#if defined(UART4_BASE)
274274
case 3:
275-
__UART4_FORCE_RESET();
276-
__UART4_RELEASE_RESET();
277-
__UART4_CLK_DISABLE();
275+
__HAL_RCC_UART4_FORCE_RESET();
276+
__HAL_RCC_UART4_RELEASE_RESET();
277+
__HAL_RCC_UART4_CLK_DISABLE();
278278
break;
279279
#endif
280280
#if defined(UART5_BASE)
281281
case 4:
282-
__UART5_FORCE_RESET();
283-
__UART5_RELEASE_RESET();
284-
__UART5_CLK_DISABLE();
282+
__HAL_RCC_UART5_FORCE_RESET();
283+
__HAL_RCC_UART5_RELEASE_RESET();
284+
__HAL_RCC_UART5_CLK_DISABLE();
285285
break;
286286
#endif
287287
#if defined(USART6_BASE)
288288
case 5:
289-
__USART6_FORCE_RESET();
290-
__USART6_RELEASE_RESET();
291-
__USART6_CLK_DISABLE();
289+
__HAL_RCC_USART6_FORCE_RESET();
290+
__HAL_RCC_USART6_RELEASE_RESET();
291+
__HAL_RCC_USART6_CLK_DISABLE();
292292
break;
293293
#endif
294294
#if defined(UART7_BASE)
295295
case 6:
296-
__UART7_FORCE_RESET();
297-
__UART7_RELEASE_RESET();
298-
__UART7_CLK_DISABLE();
296+
__HAL_RCC_UART7_FORCE_RESET();
297+
__HAL_RCC_UART7_RELEASE_RESET();
298+
__HAL_RCC_UART7_CLK_DISABLE();
299299
break;
300300
#endif
301301
#if defined(UART8_BASE)
302302
case 7:
303-
__UART8_FORCE_RESET();
304-
__UART8_RELEASE_RESET();
305-
__UART8_CLK_DISABLE();
303+
__HAL_RCC_UART8_FORCE_RESET();
304+
__HAL_RCC_UART8_RELEASE_RESET();
305+
__HAL_RCC_UART8_CLK_DISABLE();
306306
break;
307307
#endif
308308
}

0 commit comments

Comments
 (0)