1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +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:
stac 2010-05-27 01:37:43 +00:00 committed by stac
parent 918250868b
commit 140a51932f

View File

@ -374,7 +374,7 @@ int32_t PIOS_SPI_TransferModeInit(uint8_t spi, SPIModeTypeDef spi_mode, SPIPresc
} break;
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 */
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);
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 */
/* clock configuration has been changed - we should send a dummy byte */
/* before the application activates chip select. */