File tree Expand file tree Collapse file tree 1 file changed +2
-32
lines changed
bsp/stm32/libraries/HAL_Drivers/drivers Expand file tree Collapse file tree 1 file changed +2
-32
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2006-2023 , RT-Thread Development Team
2+ * Copyright (c) 2006-2024 , RT-Thread Development Team
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 *
@@ -156,36 +156,6 @@ void stm32_dir_miso(void *data, rt_int32_t state)
156156 }
157157}
158158
159- static void stm32_udelay (rt_uint32_t us )
160- {
161- rt_uint32_t ticks ;
162- rt_uint32_t told , tnow , tcnt = 0 ;
163- rt_uint32_t reload = SysTick -> LOAD ;
164-
165- ticks = us * reload / (1000000UL / RT_TICK_PER_SECOND );
166- told = SysTick -> VAL ;
167- while (1 )
168- {
169- tnow = SysTick -> VAL ;
170- if (tnow != told )
171- {
172- if (tnow < told )
173- {
174- tcnt += told - tnow ;
175- }
176- else
177- {
178- tcnt += reload - tnow + told ;
179- }
180- told = tnow ;
181- if (tcnt >= ticks )
182- {
183- break ;
184- }
185- }
186- }
187- }
188-
189159static void stm32_pin_init (void )
190160{
191161 rt_size_t obj_num = sizeof (spi_obj ) / sizeof (struct stm32_soft_spi );
@@ -209,7 +179,7 @@ static struct rt_spi_bit_ops stm32_soft_spi_ops =
209179 .get_miso = stm32_get_miso ,
210180 .dir_mosi = stm32_dir_mosi ,
211181 .dir_miso = stm32_dir_miso ,
212- .udelay = stm32_udelay ,
182+ .udelay = rt_hw_us_delay ,
213183 .delay_us = 1 ,
214184};
215185
You can’t perform that action at this time.
0 commit comments