diff --git a/flight/Libraries/ahrs_spi_comm.c b/flight/Libraries/ahrs_spi_comm.c index 8b0a506a6..c839f3791 100644 --- a/flight/Libraries/ahrs_spi_comm.c +++ b/flight/Libraries/ahrs_spi_comm.c @@ -53,7 +53,7 @@ typedef enum { COMMS_NULL, COMMS_OBJECT } COMMSCOMMAND; //The maximum number of objects that can be updated in one cycle. //Currently the link is capable of sending 3 packets per cycle but 2 is enough -#define MAX_UPDATE_OBJECTS 2 +#define MAX_UPDATE_OBJECTS 1 //Number of transmissions + 1 before we expect to see the data acknowledge //This is controlled by the SPI hardware. @@ -144,7 +144,7 @@ void AhrsInitComms(void) #ifdef IN_AHRS PIOS_SPI_Init(); #else - PIOS_SPI_SetClockSpeed(PIOS_OPAHRS_SPI, PIOS_SPI_PRESCALER_8); //36MHz/16 = 2.25MHz + /* Comms already init in OP code */ for (int ct = 0; ct < MAX_AHRS_OBJECTS; ct++) { AhrsObjHandle hdl = AhrsFromIndex(ct); if (hdl) { diff --git a/flight/OpenPilot/System/pios_board.c b/flight/OpenPilot/System/pios_board.c index 4903e13dd..7b13c0400 100644 --- a/flight/OpenPilot/System/pios_board.c +++ b/flight/OpenPilot/System/pios_board.c @@ -101,7 +101,7 @@ const struct pios_spi_cfg pios_spi_sdcard_cfg = { .SPI_CRCPolynomial = 7, .SPI_CPOL = SPI_CPOL_High, .SPI_CPHA = SPI_CPHA_2Edge, - .SPI_BaudRatePrescaler = 7 << 3, /* Maximum divider (ie. slowest clock rate) */ + .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256, /* Maximum divider (ie. slowest clock rate) */ }, .dma = { .ahb_clk = RCC_AHBPeriph_DMA1, @@ -199,7 +199,7 @@ const struct pios_spi_cfg pios_spi_ahrs_cfg = { .SPI_CRCPolynomial = 7, .SPI_CPOL = SPI_CPOL_High, .SPI_CPHA = SPI_CPHA_2Edge, - .SPI_BaudRatePrescaler = 7 << 3, /* Maximum divider (ie. slowest clock rate) */ + .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_16, }, .use_crc = TRUE, .dma = {