sensor: bmp280: fix pressure value
The comments in the sensor header specify that pressure should be expressed in kPa, but the bmp280 driver returns a value in Pa. Change-Id: I6d5346db250d1a01a1e5e31fb1d8685ab5dc405b Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
This commit is contained in:
parent
45a269f3b0
commit
320651281c
|
@ -151,8 +151,9 @@ static int bmp280_channel_get(struct device *dev,
|
|||
* 24674867/256 = 96386.2 Pa = 963.862 hPa
|
||||
*/
|
||||
val->type = SENSOR_TYPE_INT_PLUS_MICRO;
|
||||
val->val1 = data->comp_press >> 8;
|
||||
val->val2 = ((data->comp_press & 0xff) * 1000000) >> 8;
|
||||
val->val1 = (data->comp_press >> 8) / 1000;
|
||||
val->val2 = (data->comp_press >> 8) % 1000 * 1000 +
|
||||
(((data->comp_press & 0xff) * 1000) >> 8);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Reference in a new issue