sensor: remove sensor value type

Remove the type field from the sensor value structure. All values will
have the type previously defined by SENSOR_VALUE_TYPE_INT_PLUS_MICRO.

This simplifies the interface, as apps will know what value type to
expect. Apps that prefer to use double values can optain them using the
sensor_value_to_double function.

Change-Id: I3588d74258030eb16c3f89d8eead13cca4606b18
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
This commit is contained in:
Bogdan Davidoaia 2017-01-12 15:28:25 +02:00 committed by Anas Nashif
commit 30162aedf1
41 changed files with 44 additions and 253 deletions

View file

@ -87,10 +87,6 @@ int bmg160_slope_config(struct device *dev, enum sensor_attribute attr,
uint16_t any_th_dps, range_dps;
uint8_t any_th_reg_val;
if (val->type != SENSOR_VALUE_TYPE_INT_PLUS_MICRO) {
return -EINVAL;
}
any_th_dps = sensor_rad_to_degrees(val);
range_dps = BMG160_SCALE_TO_RANGE(bmg160->scale);
any_th_reg_val = any_th_dps * 2000 / range_dps;
@ -103,10 +99,6 @@ int bmg160_slope_config(struct device *dev, enum sensor_attribute attr,
return bmg160_write_byte(dev, BMG160_REG_THRES,
any_th_dps & BMG160_THRES_MASK);
} else if (attr == SENSOR_ATTR_SLOPE_DUR) {
if (val->type != SENSOR_VALUE_TYPE_INT_PLUS_MICRO) {
return -EINVAL;
}
/* slope duration can be 4, 8, 12 or 16 samples */
if (val->val1 != 4 && val->val1 != 8 &&
val->val1 != 12 && val->val1 != 16) {