Skip to content

Commit

Permalink
- Moved CalibrationHandler configs under magnetometer segment
Browse files Browse the repository at this point in the history
 - Introduced new configs for device variants
  • Loading branch information
Antti Virtanen committed Feb 4, 2011
1 parent 68562b6 commit be28d46
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 88 deletions.
78 changes: 1 addition & 77 deletions config/90-sensord-default.conf
@@ -1,79 +1,3 @@
[global]
device_sys_path = /dev/input/event%1
device_poll_file_path = /sys/class/input/input%1/poll

# Proximity adaptor
#proximity_dev_path = /dev/bh1770glc_ps
proximity_dev_path_rm680 = /dev/bh1770glc_ps
proximity_dev_path_rm696 = /dev/apds990x0

# Proximity-evdev adaptor for Nokia N900
proximity-evdev_match_name = gpio-keys

# ALS adaptor
#als_dev_path = /dev/bh1770glc_als
als_dev_path_rm680 = /dev/bh1770glc_als
als_dev_path_rm696 = /dev/apds990x0


# ALS adaptor sysfs for Nokia N900
als-sysfs_path = /sys/devices/platform/i2c_omap.2/i2c-2/2-0029/device0/illuminance0_input

# Magnetometer drivers
mag_ak8974_dev_path = /dev/ak89740
mag_ak8975_dev_path = /dev/ak89750

# Accelerometer coordinate transformation matrix
# (values separated by commas, concatenate rows from top to bottom)
acc_trans_matrix = "-1,0,0,0,-1,0,0,0,-1"

# Coefficient for scaling the output of magnetometer sensor
# Depending on HW/algorithms, the output from driver and in processing
# may not be milliTeslas. This coefficient can be used to scale them to
# proper mT values. '300' is correct for AK897X, which use 0.3T as
# value of LSB. Set to '1' to avoid scaling.
magnetometer_scale_coefficient = 300

# Orientation parameters
orientation_threshold_landscape = 25
orientation_threshold_portrait = 20
orientation_overflow_min = 800
orientation_overflow_max = 1250
orientation_poll_interval = 1000

# Offset for Screen.TopEdge. If 0, Screen.TopEdge equals side edges from
# OrientationSensor. Each additional value rotates the top one step to
# clock-wise direction.
orientation_offset = 3

# How old samples can we safely ignore for desktop orientation (microsecs)
# Increase to make more stable, decrease to add sensitivity
orientation_discard_time = 750000

# How many seconds should we wait without any accelerometer samples
# to declare that the device must be static?
# Affects Position.Stable. Note that the property also changes value
# based on the incoming values, not only this timeout.
stability_timeout = 60

# The interval used for magnetometer while calibrating (millisecs)
calibration_rate = 100

# The timeout when calibration stops if calibration level doesn't change (millisecs)
calibration_timeout = 60000

### Plugins
###
### Provide the actual plugin name (libsensor.so --> sensor) for the
### plugin dependencies. If a value is not found / set, the key is used
### as the value

# Set this to match the device, until automatic detection is enabled
deviceId = default

[default]
accelerometeradaptor = accelerometeradaptor

[n900]
accelerometeradaptor = accelerometeradaptor
alsadaptor = alsadaptor-sysfs
proximityadaptor = proximityadaptor-evdev
49 changes: 49 additions & 0 deletions config/sensord-n900.conf
@@ -0,0 +1,49 @@
[plugins]
alsadaptor = alsadaptor-sysfs
proximityadaptor = proximityadaptor-evdev

[accelerometer]
dataranges = -2048=>2048
intervals = 0,10=>1000
transformation_matrix = "0,-1,0,1,0,0,0,0,-1"

[als]
path = /sys/bus/i2c/drivers/apds990x/0-0039/lux_output
dataranges = 0=>65535
intervals = 50=>2000
default_interval = 1000

[keyboardslider]
input_match = gpio-keys
dataranges = 0=>2
intervals = 0

[proximity]
path = /sys/bus/i2c/devices/5-0055/apds9802ps/proximity_output
dataranges = 0=>4096

[magnetometer]
path = /dev/ak89750
dataranges = -4096=>4096
intervals = 25=>1000
default_interval = 1000
scale_coefficient = 300
calibration_rate = 100
calibration_timeout = 60000

[tap]
device = accelerometer
dataranges = 0=>2
intervals = 0

[orientation]
threshold_landscape = 25
threshold_portrait = 20
overflow_min = 800
overflow_max = 1250
discard_time = 750000

[context]
orientation_poll_interval = 0
orientation_offset = 0
stability_timeout = 60
49 changes: 49 additions & 0 deletions config/sensord-ncdk.conf
@@ -0,0 +1,49 @@
[plugins]
alsadaptor = alsadaptor-ascii
proximityadaptor = proximityadaptor-ascii

[accelerometer]
dataranges = -2048=>2048
intervals = 0,10=>1000
transformation_matrix = "-1,0,0,0,-1,0,0,0,-1"

[als]
path = /sys/bus/i2c/drivers/apds990x/0-0039/lux_output
dataranges = 0=>65535
intervals = 50=>2000
default_interval = 1000

[keyboardslider]
input_match = gpio-keys
dataranges = 0=>2
intervals = 0

[proximity]
path = /sys/bus/i2c/devices/5-0055/apds9802ps/proximity_output
dataranges = 0=>4096

[magnetometer]
path = /dev/ak89750
dataranges = -4096=>4096
intervals = 25=>1000
default_interval = 1000
scale_coefficient = 300
calibration_rate = 100
calibration_timeout = 60000

[tap]
device = accelerometer
dataranges = 0=>2
intervals = 0

[orientation]
threshold_landscape = 25
threshold_portrait = 20
overflow_min = 800
overflow_max = 1250
discard_time = 750000

[context]
orientation_poll_interval = 0
orientation_offset = 0
stability_timeout = 60
47 changes: 47 additions & 0 deletions config/sensord-rm680.conf
@@ -0,0 +1,47 @@
[accelerometer]
dataranges = -2048=>2048
intervals = 0,10=>1000
transformation_matrix = "-1,0,0,0,-1,0,0,0,-1"

[als]
driver_type = 1
path = /dev/bh1770glc_als
dataranges = 0=>65535
intervals = 0

[keyboardslider]
input_match = gpio-keys
dataranges = 0=>2
intervals = 0

[proximity]
driver_type = 1
path = /dev/bh1770glc_ps
dataranges = 0=>1
intervals = 0

[magnetometer]
path = /dev/ak89740
dataranges = -2048=>2048
intervals = 25=>1000
default_interval = 1000
scale_coefficient = 300
calibration_rate = 100
calibration_timeout = 60000

[tap]
device = accelerometer
dataranges = 0=>2
intervals = 0

[orientation]
threshold_landscape = 25
threshold_portrait = 20
overflow_min = 800
overflow_max = 1250
discard_time = 750000

[context]
orientation_poll_interval = 1000
orientation_offset = 3
stability_timeout = 60
48 changes: 48 additions & 0 deletions config/sensord-rm696.conf
@@ -0,0 +1,48 @@
[accelerometer]
dataranges = -2048=>2048
intervals = 0,10=>1000
transformation_matrix = "-1,0,0,0,-1,0,0,0,-1"

[als]
driver_type = 2
path = /dev/apds990x0
dataranges = 0=>65535
intervals = 0

[keyboardslider]
input_match = gpio-keys
dataranges = 0=>2
intervals = 0

[proximity]
driver_type = 2
path = /dev/apds990x0
dataranges = 0=>1
intervals = 0

[magnetometer]
path = /dev/ak89750
dataranges = -4096=>4096
intervals = 25=>1000
default_interval = 1000
interval_compensation = 16
scale_coefficient = 300
calibration_rate = 100
calibration_timeout = 60000

[tap]
device = accelerometer
dataranges = 0=>2
intervals = 0

[orientation]
threshold_landscape = 25
threshold_portrait = 20
overflow_min = 800
overflow_max = 1250
discard_time = 750000

[context]
orientation_poll_interval = 1000
orientation_offset = 3
stability_timeout = 60
8 changes: 1 addition & 7 deletions config/sensord.conf
@@ -1,7 +1 @@

# This is the master configuration file for sensor framework.
#
# Any options set here will have priority over options set in any of the files
# in sensord.conf.d/
#
#
# This is the configuration template file
4 changes: 2 additions & 2 deletions core/calibrationhandler.cpp
Expand Up @@ -39,8 +39,8 @@ CalibrationHandler::CalibrationHandler(QObject* parent) : QObject(parent),
{
m_timer.setSingleShot(true);

calibration_rate = Config::configuration()->value("calibration_rate", QVariant(100)).toInt();
calib_timeout = Config::configuration()->value("calibration_timeout", QVariant(60000)).toInt();
calibration_rate = Config::configuration()->value("magnetometer/calibration_rate", QVariant(100)).toInt();
calib_timeout = Config::configuration()->value("magnetometer/calibration_timeout", QVariant(60000)).toInt();
}

CalibrationHandler::~CalibrationHandler()
Expand Down
4 changes: 2 additions & 2 deletions core/inputdevadaptor.cpp
Expand Up @@ -46,8 +46,8 @@ InputDevAdaptor::InputDevAdaptor(const QString& id, int maxDeviceCount) :
deviceNumber_(-1),
originalPollingInterval_(0)
{
deviceSysPathString_ = Config::configuration()->value("device_sys_path").toString();
devicePollFilePath_ = Config::configuration()->value("device_poll_file_path").toString();
deviceSysPathString_ = Config::configuration()->value("global/device_sys_path").toString();
devicePollFilePath_ = Config::configuration()->value("global/device_poll_file_path").toString();
}

InputDevAdaptor::~InputDevAdaptor()
Expand Down

0 comments on commit be28d46

Please sign in to comment.