mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-10 18:24:11 +01:00
LP-328 uncrustified
This commit is contained in:
parent
10637550d7
commit
f27db8b65c
@ -732,15 +732,12 @@ void PIOS_HMC5x83_driver_fetch(void *data, uint8_t size, uintptr_t context)
|
|||||||
|
|
||||||
PIOS_SENSORS_3Axis_SensorsWithTemp *tmp = data;
|
PIOS_SENSORS_3Axis_SensorsWithTemp *tmp = data;
|
||||||
|
|
||||||
if(!dev->hw_error && (PIOS_HMC5x83_ReadMag((pios_hmc5x83_dev_t)context, mag) == 0))
|
if (!dev->hw_error && (PIOS_HMC5x83_ReadMag((pios_hmc5x83_dev_t)context, mag) == 0)) {
|
||||||
{
|
|
||||||
tmp->count = 1;
|
tmp->count = 1;
|
||||||
tmp->sample[0].x = mag[0];
|
tmp->sample[0].x = mag[0];
|
||||||
tmp->sample[0].y = mag[1];
|
tmp->sample[0].y = mag[1];
|
||||||
tmp->sample[0].z = mag[2];
|
tmp->sample[0].z = mag[2];
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
tmp->count = 1;
|
tmp->count = 1;
|
||||||
tmp->sample[0].x = 0;
|
tmp->sample[0].x = 0;
|
||||||
tmp->sample[0].y = 0;
|
tmp->sample[0].y = 0;
|
||||||
@ -750,7 +747,6 @@ void PIOS_HMC5x83_driver_fetch(void *data, uint8_t size, uintptr_t context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmp->temperature = 0;
|
tmp->temperature = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -758,9 +754,8 @@ bool PIOS_HMC5x83_driver_poll(uintptr_t context)
|
|||||||
{
|
{
|
||||||
pios_hmc5x83_dev_data_t *dev = dev_validate((pios_hmc5x83_dev_t)context);
|
pios_hmc5x83_dev_data_t *dev = dev_validate((pios_hmc5x83_dev_t)context);
|
||||||
|
|
||||||
if(dev->hw_error) {
|
if (dev->hw_error) {
|
||||||
|
if (PIOS_DELAY_DiffuS(dev->lastConfigTime) < 1000000) {
|
||||||
if(PIOS_DELAY_DiffuS(dev->lastConfigTime) < 1000000) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,10 +764,9 @@ bool PIOS_HMC5x83_driver_poll(uintptr_t context)
|
|||||||
PIOS_WDG_Clear();
|
PIOS_WDG_Clear();
|
||||||
#endif /* PIOS_INCLUDE_WDG */
|
#endif /* PIOS_INCLUDE_WDG */
|
||||||
|
|
||||||
if(PIOS_HMC5x83_Config(dev) == 0) {
|
if (PIOS_HMC5x83_Config(dev) == 0) {
|
||||||
dev->hw_error = false;
|
dev->hw_error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return PIOS_HMC5x83_NewDataAvailable((pios_hmc5x83_dev_t)context);
|
return PIOS_HMC5x83_NewDataAvailable((pios_hmc5x83_dev_t)context);
|
||||||
|
Loading…
Reference in New Issue
Block a user