Skip to content

Commit d79f346

Browse files
GD32 changed calculation for delay() loop to use F_CPU
1 parent 7bea296 commit d79f346

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

  • GD32F1/system/libmaple/stm32f1/include/series

GD32F1/system/libmaple/stm32f1/include/series/stm32.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -227,27 +227,8 @@ extern "C" {
227227
# define STM32_PCLK2 F_CPU
228228
# endif
229229
# ifndef STM32_DELAY_US_MULT
230-
#if F_CPU == 120000000
231-
#define STM32_DELAY_US_MULT 40 /* FIXME: value is incorrect. */
232-
#elif F_CPU == 96000000
233-
#define STM32_DELAY_US_MULT 32 /* FIXME: value is incorrect. */
234-
#elif F_CPU == 72000000
235-
#define STM32_DELAY_US_MULT 24 /* FIXME: value is incorrect. */
236-
#endif
237-
# endif
238-
#elif STM32_F1_LINE == STM32_F1_LINE_VALUE /* TODO */
239-
# ifndef STM32_PCLK1
240-
# define STM32_PCLK1 12000000U
241-
# endif
242-
# ifndef STM32_PCLK2
243-
# define STM32_PCLK2 24000000U
244-
# endif
245-
# ifndef STM32_DELAY_US_MULT
246-
# define STM32_DELAY_US_MULT 8 /* FIXME: value is incorrect. */
230+
# define STM32_DELAY_US_MULT (F_CPU / 3000000L)
247231
# endif
248-
#elif STM32_F1_LINE == STM32_F1_LINE_ACCESS /* TODO */
249-
#elif STM32_F1_LINE == STM32_F1_LINE_USB_ACCESS /* TODO */
250-
#elif STM32_F1_LINE == STM32_F1_LINE_CONNECTIVITY /* TODO */
251232
#endif
252233

253234
/*

0 commit comments

Comments
 (0)