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:
parent
ce2d0fcbb1
commit
1b5e776dc5
@ -256,15 +256,14 @@ int32_t PIOS_L3GD20_ReadFifo(struct pios_l3gd20_data * buffer)
|
|||||||
|
|
||||||
float PIOS_L3GD20_GetScale()
|
float PIOS_L3GD20_GetScale()
|
||||||
{
|
{
|
||||||
|
return 0.01750f;
|
||||||
switch (cfg->gyro_range) {
|
switch (cfg->gyro_range) {
|
||||||
case PIOS_L3GD20_SCALE_250_DEG:
|
case PIOS_L3GD20_SCALE_250_DEG:
|
||||||
return 1.0f / 131.0f;
|
return 0.00875f;
|
||||||
case PIOS_L3GD20_SCALE_500_DEG:
|
case PIOS_L3GD20_SCALE_500_DEG:
|
||||||
return 1.0f / 65.5f;
|
return 0.01750f;
|
||||||
case PIOS_L3GD20_SCALE_1000_DEG:
|
|
||||||
return 1.0f / 32.8f;
|
|
||||||
case PIOS_L3GD20_SCALE_2000_DEG:
|
case PIOS_L3GD20_SCALE_2000_DEG:
|
||||||
return 1.0f / 16.4f;
|
return 0.070f;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,6 @@
|
|||||||
enum pios_l3gd20_range {
|
enum pios_l3gd20_range {
|
||||||
PIOS_L3GD20_SCALE_250_DEG = 0x00,
|
PIOS_L3GD20_SCALE_250_DEG = 0x00,
|
||||||
PIOS_L3GD20_SCALE_500_DEG = 0x08,
|
PIOS_L3GD20_SCALE_500_DEG = 0x08,
|
||||||
PIOS_L3GD20_SCALE_1000_DEG = 0x10,
|
|
||||||
PIOS_L3GD20_SCALE_2000_DEG = 0x18
|
PIOS_L3GD20_SCALE_2000_DEG = 0x18
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1526,6 +1526,7 @@ static const struct pios_l3gd20_cfg pios_l3gd20_cfg = {
|
|||||||
.NVIC_IRQChannelCmd = ENABLE,
|
.NVIC_IRQChannelCmd = ENABLE,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
.gyro_range = PIOS_L3GD20_SCALE_500_DEG,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user