1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

Merge pull request #16136 from silkeh/pr/bme280-pa

driver/bmx280: increase accuracy of SAUL pressure readings
This commit is contained in:
Jean Pierre Dudey 2021-03-05 11:26:06 +01:00 committed by GitHub
commit e54af1ce40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,9 +35,11 @@ static int read_temperature(const void *dev, phydat_t *res)
static int read_pressure(const void *dev, phydat_t *res)
{
res->val[0] = bmx280_read_pressure((bmx280_t *)dev) / 100;
res->unit = UNIT_PA;
res->scale = 2;
res->scale = 0;
int32_t val = bmx280_read_pressure((bmx280_t *)dev);
phydat_fit(res, &val, 1);
return 1;
}