IMU: select CAN vs SPI
This commit is contained in:
parent
f54d7d56bc
commit
6b957e33b7
|
@ -178,8 +178,10 @@ void processCanRxMessage(const size_t busIndex, const CANRxFrame &frame, efitick
|
||||||
//Vss is configurable, should we handle it here:
|
//Vss is configurable, should we handle it here:
|
||||||
processCanRxVss(frame, nowNt);
|
processCanRxVss(frame, nowNt);
|
||||||
|
|
||||||
|
if (!engineConfiguration->useSpiImu) {
|
||||||
// todo: convert to CanListener or not?
|
// todo: convert to CanListener or not?
|
||||||
processCanRxImu(frame);
|
processCanRxImu(frame);
|
||||||
|
}
|
||||||
|
|
||||||
processCanBenchTest(frame);
|
processCanBenchTest(frame);
|
||||||
|
|
||||||
|
|
|
@ -124,11 +124,13 @@ private:
|
||||||
lsm303agrAccelerometerReadCooked(&LIS2DH12, acccooked);
|
lsm303agrAccelerometerReadCooked(&LIS2DH12, acccooked);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (engineConfiguration->useSpiImu) {
|
||||||
/* milli-G to G */
|
/* milli-G to G */
|
||||||
engine->sensors.accelerometer.lat = acccooked[0] / 1000.0;
|
engine->sensors.accelerometer.lat = acccooked[0] / 1000.0;
|
||||||
engine->sensors.accelerometer.lon = acccooked[1] / 1000.0;
|
engine->sensors.accelerometer.lon = acccooked[1] / 1000.0;
|
||||||
engine->sensors.accelerometer.vert = acccooked[2] / 1000.0;
|
engine->sensors.accelerometer.vert = acccooked[2] / 1000.0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static AccelController instance;
|
static AccelController instance;
|
||||||
|
|
Loading…
Reference in New Issue