mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +01:00
spi: fix cut/paste error for AHRS SPI setup
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@669 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
918250868b
commit
140a51932f
@ -374,7 +374,7 @@ int32_t PIOS_SPI_TransferModeInit(uint8_t spi, SPIModeTypeDef spi_mode, SPIPresc
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 1: {
|
case 1: {
|
||||||
uint16_t prev_cr1 = PIOS_SPI0_PTR->CR1;
|
uint16_t prev_cr1 = PIOS_SPI1_PTR->CR1;
|
||||||
|
|
||||||
/* SPI2 perpipheral is located in APB1 domain and clocked at half speed */
|
/* SPI2 perpipheral is located in APB1 domain and clocked at half speed */
|
||||||
if(spi_prescaler == 0) {
|
if(spi_prescaler == 0) {
|
||||||
@ -384,7 +384,7 @@ int32_t PIOS_SPI_TransferModeInit(uint8_t spi, SPIModeTypeDef spi_mode, SPIPresc
|
|||||||
}
|
}
|
||||||
SPI_Init(PIOS_SPI1_PTR, &SPI_InitStructure);
|
SPI_Init(PIOS_SPI1_PTR, &SPI_InitStructure);
|
||||||
|
|
||||||
if((prev_cr1 ^ PIOS_SPI0_PTR->CR1) & 3) {
|
if((prev_cr1 ^ PIOS_SPI1_PTR->CR1) & 3) {
|
||||||
/* CPOL and CPHA located at bit #1 and #0 */
|
/* CPOL and CPHA located at bit #1 and #0 */
|
||||||
/* clock configuration has been changed - we should send a dummy byte */
|
/* clock configuration has been changed - we should send a dummy byte */
|
||||||
/* before the application activates chip select. */
|
/* before the application activates chip select. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user