1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

Hardcoded scale for now since it isn't picking up from the cfg structure.

This commit is contained in:
James Cotton 2012-01-17 19:53:20 -06:00
parent ce2d0fcbb1
commit 1b5e776dc5
3 changed files with 5 additions and 6 deletions

View File

@ -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;
}

View File

@ -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
};

View File

@ -1526,6 +1526,7 @@ static const struct pios_l3gd20_cfg pios_l3gd20_cfg = {
.NVIC_IRQChannelCmd = ENABLE,
},
},
.gyro_range = PIOS_L3GD20_SCALE_500_DEG,
};
/**