1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-238 AHRS Comms: Bring down clock rate of comms to AHRS to 2.25 MHz. Decrease

to only transmitting one object per transmission too to keep size down.
Also move to using the driver structure so the paramter is in a clear place.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2333 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2011-01-05 10:34:42 +00:00 committed by peabody124
parent 3e9ee37c73
commit 0e7661539e
2 changed files with 4 additions and 4 deletions

View File

@ -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) {

View File

@ -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 = {