|
|
@@ -323,7 +323,7 @@ uint8_t Icm20948::GetIndex(void)
|
|
|
Sensor::Sensor(IcmSpiManager *spi, int8_t activeDevice){
|
|
|
_spi = spi;
|
|
|
_activeDevice = activeDevice;
|
|
|
- _scaleFactor = 1.0f;
|
|
|
+ _scaleFactor = 1;
|
|
|
offset_x = 0;
|
|
|
offset_y = 0;
|
|
|
offset_z = 0;
|
|
|
@@ -356,7 +356,7 @@ SensorMag::SensorMag(IcmSpiManager *spi, int8_t activeDevice):Sensor(spi, active
|
|
|
|
|
|
}
|
|
|
|
|
|
-void Sensor::SetScaleFactor(float sf){
|
|
|
+void Sensor::SetScaleFactor(int16_t sf){
|
|
|
_scaleFactor = sf;
|
|
|
}
|
|
|
|
|
|
@@ -492,7 +492,7 @@ void SensorAccel::SetRange(accel_full_scale full_scale)
|
|
|
{
|
|
|
uint8_t new_val = _spi->read_single_reg(_activeDevice, ub_2, B2_ACCEL_CONFIG);
|
|
|
new_val = new_val & 0xF9; // remova ACCEL_FS_SEL bites [1-2]
|
|
|
- float accel_scale_factor;
|
|
|
+ int16_t accel_scale_factor;
|
|
|
switch(full_scale)
|
|
|
{
|
|
|
case ACCEL_FS_2g :
|