1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

sysclk: pass in correct definition for HSE_VALUE

The code in RCC_GetClocksFreq() uses HSE_VALUE to determine
the tick rate of the SYSCLK.  This in turn is used by the
code in PIOS_DELAY_* to compute delays.

ST Library defaults this to 25MHz for the F4.  Our board
actually has an 8MHz oscillator so delays were way off.

Mostly affects the bootloaders since most FW code uses RTOS
delays rather than busy-waiting using PIOS_DELAY_*.
This commit is contained in:
Stacey Sheldon 2012-03-04 19:50:27 -05:00
parent fdf54ab86c
commit e2ab662b5d
3 changed files with 5 additions and 3 deletions

View File

@ -163,7 +163,9 @@ DEBUGF = dwarf-2
# Place project-specific -D (define) and/or # Place project-specific -D (define) and/or
# -U options for C here. # -U options for C here.
CDEFS = -DSTM32F10X_$(MODEL) CDEFS = -DSTM32F4XX
CDEFS += -DSYSCLK_FREQ=$(SYSCLK_FREQ)
CDEFS += -DHSE_VALUE=$(OSCILLATOR_FREQ)
CDEFS += -DUSE_STDPERIPH_DRIVER CDEFS += -DUSE_STDPERIPH_DRIVER
CDEFS += -DUSE_$(BOARD) CDEFS += -DUSE_$(BOARD)

View File

@ -273,7 +273,7 @@ DEBUGF = dwarf-2
# Place project-specific -D (define) and/or # Place project-specific -D (define) and/or
# -U options for C here. # -U options for C here.
CDEFS += -DSTM32F10X_$(MODEL) CDEFS += -DHSE_VALUE=$(OSCILLATOR_FREQ)
CDEFS += -DSYSCLK_FREQ=$(SYSCLK_FREQ) CDEFS += -DSYSCLK_FREQ=$(SYSCLK_FREQ)
CDEFS += -DUSE_STDPERIPH_DRIVER CDEFS += -DUSE_STDPERIPH_DRIVER
CDEFS += -DUSE_$(BOARD) CDEFS += -DUSE_$(BOARD)