From a5bafb399ff686b1467106643c05580607a069e7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 20 Jan 2018 16:56:56 +1100 Subject: [PATCH] HAL_ChibiOS: adjust SPI pin speeds --- libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat | 2 +- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat index 7b8cf98f57..77f98b356c 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat @@ -99,7 +99,7 @@ PD7 BARO_CS CS # USART3 serial3 telem2 PD8 USART3_TX USART3 PD9 USART3_RX USART3 -PD10 FRAM_CS CS SPEED_LOW +PD10 FRAM_CS CS SPEED_VERYLOW PD11 USART3_CTS USART3 PD12 USART3_RTS USART3 PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 7b07166b4e..6917f006f5 100755 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -169,12 +169,9 @@ class generic_pin(object): def get_OSPEEDR(self): '''return one of SPEED_VERYLOW, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH''' + # on STM32F4 these speeds correspond to 2MHz, 25MHz, 50MHz and 100MHz values = ['SPEED_VERYLOW', 'SPEED_LOW', 'SPEED_MEDIUM', 'SPEED_HIGH'] - v = 'SPEED_HIGH' - if self.is_CS(): - v = "SPEED_MEDIUM" - if self.type.startswith("I2C"): - v = "SPEED_MEDIUM" + v = 'SPEED_MEDIUM' for e in self.extra: if e in values: v = e