Commit 02098f09 authored by spiiroin's avatar spiiroin

Merge branch 'iioadaptor-scale-override' into 'master'

[iioadaptor] Allow overriding iioDevices' scaling factor

See merge request !39
parents 61a9d7e8 19aa31b8
......@@ -145,6 +145,14 @@ void IioAdaptor::setup()
iioDevice.channels = scanElementsEnable(devNodeNumber,1);
scanElementsEnable(devNodeNumber,0);
/* Override the scaling factor if asked */
bool ok;
double scale_override = SensorFrameworkConfig::configuration()->value(iioDevice.name + "/scale").toDouble(&ok);
if (ok) {
sensordLogD() << "Overriding scale to" << scale_override;
iioDevice.scale = scale_override;
}
introduceAvailableDataRange(DataRange(0, 65535, 1));
introduceAvailableInterval(DataRange(0, 586, 0));
setDefaultInterval(10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment