Skip to content

Commit

Permalink
[compilation] Provide fallback SENSOR_TYPE_STEP_COUNTER value. MER#1749
Browse files Browse the repository at this point in the history
If android sensors.h available at build time does not define step counter
sensor type, compilation will fail.

Make sure SENSOR_TYPE_STEP_COUNTER is defined where needed.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Feb 8, 2017
1 parent b61c496 commit fcd8fa5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -26,6 +26,10 @@
#include "datatypes/utils.h"
#include <hardware/sensors.h>

#ifndef SENSOR_TYPE_STEP_COUNTER
#define SENSOR_TYPE_STEP_COUNTER (19)
#endif

HybrisStepCounterAdaptor::HybrisStepCounterAdaptor(const QString& id) :
HybrisAdaptor(id, SENSOR_TYPE_STEP_COUNTER)
{
Expand Down
4 changes: 3 additions & 1 deletion core/hybrisadaptor.cpp
Expand Up @@ -72,7 +72,9 @@
//#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED (16)
//#define SENSOR_TYPE_SIGNIFICANT_MOTION (17)
//#define SENSOR_TYPE_STEP_DETECTOR (18)
//#define SENSOR_TYPE_STEP_COUNTER (19)
#ifndef SENSOR_TYPE_STEP_COUNTER
#define SENSOR_TYPE_STEP_COUNTER (19)
#endif
//#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR (20)

Q_GLOBAL_STATIC(HybrisManager, hybrisManager)
Expand Down

0 comments on commit fcd8fa5

Please sign in to comment.