Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'jb39284_compass_sensor' into 'master'
Browse files Browse the repository at this point in the history
Fix interval handling so that compass sensor can be started

See merge request mer-core/sensorfw!25
  • Loading branch information
spiiroin committed Jun 19, 2018
2 parents bd1f16e + 02ee4ab commit e1566a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions chains/compasschain/compasschain.cpp
Expand Up @@ -178,6 +178,9 @@ CompassChain::CompassChain(const QString& id) :

addStandbyOverrideSource(accelerometerChain);
setIntervalSource(accelerometerChain);
} else {
addStandbyOverrideSource(orientAdaptor);
setIntervalSource(orientAdaptor);
}
}

Expand Down
10 changes: 7 additions & 3 deletions core/hybrisadaptor.cpp
Expand Up @@ -205,9 +205,13 @@ int HybrisManager::maxRange(int sensorType)

int HybrisManager::minDelay(int sensorType)
{
if (sensorMap.contains(sensorType))
return sensorList[sensorMap[sensorType]].minDelay;
return 0;
int res = 0;
if (sensorMap.contains(sensorType)) {
res = sensorList[sensorMap[sensorType]].minDelay;
// us -> ms, round up
res = (res + 999) / 1000;
}
return res;
}

int HybrisManager::resolution(int sensorType)
Expand Down

0 comments on commit e1566a8

Please sign in to comment.