X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_bmx160.h;h=c5bf0aff634fcd2ccf9453ba0757448517b81f21;hb=4891f212ab13941cbe89471114dc1e5cf0f8affb;hp=9fc3334177b1208ad82f9e256f801fdf87177b32;hpb=ff2dc6ea0e62f6534b5fb1b0ec2edd4702cf4a41;p=fw%2Faltos diff --git a/src/drivers/ao_bmx160.h b/src/drivers/ao_bmx160.h index 9fc33341..c5bf0aff 100644 --- a/src/drivers/ao_bmx160.h +++ b/src/drivers/ao_bmx160.h @@ -306,4 +306,6 @@ ao_bmx160_accel(int16_t sensor) { return (float) sensor * ((float) (BMX160_ACCEL_FULLSCALE * GRAVITY / 32767.0)); } +#define ao_bmx_accel_to_sample(accel) ((accel_t) (accel) * (32767.0f / (BMX160_ACCEL_FULLSCALE * GRAVITY))) + #endif /* _BMX160_H_ */