File tree 1 file changed +2
-32
lines changed
bsp/stm32/libraries/HAL_Drivers/drivers
1 file changed +2
-32
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2006-2023 , RT-Thread Development Team
2
+ * Copyright (c) 2006-2024 , RT-Thread Development Team
3
3
*
4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*
@@ -156,36 +156,6 @@ void stm32_dir_miso(void *data, rt_int32_t state)
156
156
}
157
157
}
158
158
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
-
189
159
static void stm32_pin_init (void )
190
160
{
191
161
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 =
209
179
.get_miso = stm32_get_miso ,
210
180
.dir_mosi = stm32_dir_mosi ,
211
181
.dir_miso = stm32_dir_miso ,
212
- .udelay = stm32_udelay ,
182
+ .udelay = rt_hw_us_delay ,
213
183
.delay_us = 1 ,
214
184
};
215
185
You can’t perform that action at this time.
0 commit comments