From 1b5e776dc59139db285dcf7252caab5af076ce2b Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 17 Jan 2012 19:53:20 -0600 Subject: [PATCH] Hardcoded scale for now since it isn't picking up from the cfg structure. --- flight/PiOS/STM32F4xx/pios_l3gd20.c | 9 ++++----- flight/PiOS/inc/pios_l3gd20.h | 1 - flight/Revolution/System/pios_board.c | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flight/PiOS/STM32F4xx/pios_l3gd20.c b/flight/PiOS/STM32F4xx/pios_l3gd20.c index 71e9f8eaa..3913eeaa8 100644 --- a/flight/PiOS/STM32F4xx/pios_l3gd20.c +++ b/flight/PiOS/STM32F4xx/pios_l3gd20.c @@ -256,15 +256,14 @@ int32_t PIOS_L3GD20_ReadFifo(struct pios_l3gd20_data * buffer) float PIOS_L3GD20_GetScale() { + return 0.01750f; switch (cfg->gyro_range) { case PIOS_L3GD20_SCALE_250_DEG: - return 1.0f / 131.0f; + return 0.00875f; case PIOS_L3GD20_SCALE_500_DEG: - return 1.0f / 65.5f; - case PIOS_L3GD20_SCALE_1000_DEG: - return 1.0f / 32.8f; + return 0.01750f; case PIOS_L3GD20_SCALE_2000_DEG: - return 1.0f / 16.4f; + return 0.070f; } return 0; } diff --git a/flight/PiOS/inc/pios_l3gd20.h b/flight/PiOS/inc/pios_l3gd20.h index 775544d6c..090c325e7 100644 --- a/flight/PiOS/inc/pios_l3gd20.h +++ b/flight/PiOS/inc/pios_l3gd20.h @@ -106,7 +106,6 @@ enum pios_l3gd20_range { PIOS_L3GD20_SCALE_250_DEG = 0x00, PIOS_L3GD20_SCALE_500_DEG = 0x08, - PIOS_L3GD20_SCALE_1000_DEG = 0x10, PIOS_L3GD20_SCALE_2000_DEG = 0x18 }; diff --git a/flight/Revolution/System/pios_board.c b/flight/Revolution/System/pios_board.c index 62dfbdec2..efb270077 100644 --- a/flight/Revolution/System/pios_board.c +++ b/flight/Revolution/System/pios_board.c @@ -1526,6 +1526,7 @@ static const struct pios_l3gd20_cfg pios_l3gd20_cfg = { .NVIC_IRQChannelCmd = ENABLE, }, }, + .gyro_range = PIOS_L3GD20_SCALE_500_DEG, }; /**