Skip to content

Commit 50f638a

Browse files
committed
Avoid use of stm32_hal_legacy definition
If required defined: USE_HAL_LEGACY Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 8e7764c commit 50f638a

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

cores/arduino/stm32/PortNames.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,64 +100,64 @@ GPIO_TypeDef *set_GPIO_Port_Clock(uint32_t port_idx) {
100100
switch (port_idx) {
101101
case PortA:
102102
gpioPort = GPIOA_BASE;
103-
__GPIOA_CLK_ENABLE();
103+
__HAL_RCC_GPIOA_CLK_ENABLE();
104104
break;
105105
case PortB:
106106
gpioPort = GPIOB_BASE;
107-
__GPIOB_CLK_ENABLE();
107+
__HAL_RCC_GPIOB_CLK_ENABLE();
108108
break;
109109
#if defined GPIOC_BASE
110110
case PortC:
111111
gpioPort = GPIOC_BASE;
112-
__GPIOC_CLK_ENABLE();
112+
__HAL_RCC_GPIOC_CLK_ENABLE();
113113
break;
114114
#endif
115115
#if defined GPIOD_BASE
116116
case PortD:
117117
gpioPort = GPIOD_BASE;
118-
__GPIOD_CLK_ENABLE();
118+
__HAL_RCC_GPIOD_CLK_ENABLE();
119119
break;
120120
#endif
121121
#if defined GPIOE_BASE
122122
case PortE:
123123
gpioPort = GPIOE_BASE;
124-
__GPIOE_CLK_ENABLE();
124+
__HAL_RCC_GPIOE_CLK_ENABLE();
125125
break;
126126
#endif
127127
#if defined GPIOF_BASE
128128
case PortF:
129129
gpioPort = GPIOF_BASE;
130-
__GPIOF_CLK_ENABLE();
130+
__HAL_RCC_GPIOF_CLK_ENABLE();
131131
break;
132132
#endif
133133
#if defined GPIOG_BASE
134134
case PortG:
135135
gpioPort = GPIOG_BASE;
136-
__GPIOG_CLK_ENABLE();
136+
__HAL_RCC_GPIOG_CLK_ENABLE();
137137
break;
138138
#endif
139139
#if defined GPIOH_BASE
140140
case PortH:
141141
gpioPort = GPIOH_BASE;
142-
__GPIOH_CLK_ENABLE();
142+
__HAL_RCC_GPIOH_CLK_ENABLE();
143143
break;
144144
#endif
145145
#if defined GPIOI_BASE
146146
case PortI:
147147
gpioPort = GPIOI_BASE;
148-
__GPIOI_CLK_ENABLE();
148+
__HAL_RCC_GPIOI_CLK_ENABLE();
149149
break;
150150
#endif
151151
#if defined GPIOJ_BASE
152152
case PortJ:
153153
gpioPort = GPIOJ_BASE;
154-
__GPIOJ_CLK_ENABLE();
154+
__HAL_RCC_GPIOJ_CLK_ENABLE();
155155
break;
156156
#endif
157157
#if defined GPIOK_BASE
158158
case PortK:
159159
gpioPort = GPIOK_BASE;
160-
__GPIOK_CLK_ENABLE();
160+
__HAL_RCC_GPIOK_CLK_ENABLE();
161161
break;
162162
#endif
163163
default:

cores/arduino/stm32/spi_com.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb)
252252
handle->Init.CLKPolarity = SPI_POLARITY_HIGH;
253253
}
254254

255-
handle->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED;
255+
handle->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
256256
handle->Init.CRCPolynomial = 7;
257257
handle->Init.DataSize = SPI_DATASIZE_8BIT;
258258

@@ -262,7 +262,7 @@ void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb)
262262
handle->Init.FirstBit = SPI_FIRSTBIT_MSB;
263263
}
264264

265-
handle->Init.TIMode = SPI_TIMODE_DISABLED;
265+
handle->Init.TIMode = SPI_TIMODE_DISABLE;
266266

267267
if(obj->pin_mosi != NC) {
268268
port = set_GPIO_Port_Clock(STM_PORT(obj->pin_mosi));

cores/arduino/stm32/twi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode, u
235235
handle->Init.OwnAddress1 = ownAddress;
236236
handle->Init.OwnAddress2 = 0xFF;
237237
handle->Init.AddressingMode = addressingMode;
238-
handle->Init.DualAddressMode = I2C_DUALADDRESS_DISABLED;
239-
handle->Init.GeneralCallMode = I2C_GENERALCALL_DISABLED;
240-
handle->Init.NoStretchMode = I2C_NOSTRETCH_DISABLED;
238+
handle->Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
239+
handle->Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
240+
handle->Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
241241

242242
if(master == 0) {
243243
HAL_NVIC_SetPriority(obj->irq, 0, 1);

0 commit comments

Comments
 (0)