-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi, thank you for your work with this library!
I'm currently building a project based on the DPS310 and am using parts of your code to interface with the sensor.
While connecting my sensor, I noticed that the measurement rate (i.e. the burst length when using the sensor in Background mode) is stored in the variables g_pressure_rate and g_temperature_rate and subsequently used to derive the scale factor.
Lines 271 to 298 in e2ee938
| switch (rate) { | |
| case DPS310_CFG_RATE_1_MEAS: | |
| *p_factor = 524288; | |
| break; | |
| case DPS310_CFG_RATE_2_MEAS: | |
| *p_factor = 1572864; | |
| break; | |
| case DPS310_CFG_RATE_4_MEAS: | |
| *p_factor = 3670016; | |
| break; | |
| case DPS310_CFG_RATE_8_MEAS: | |
| *p_factor = 7864320; | |
| break; | |
| case DPS310_CFG_RATE_16_MEAS: | |
| *p_factor = 253952; | |
| break; | |
| case DPS310_CFG_RATE_32_MEAS: | |
| *p_factor = 516096; | |
| break; | |
| case DPS310_CFG_RATE_64_MEAS: | |
| *p_factor = 1040384; | |
| break; | |
| case DPS310_CFG_RATE_128_MEAS: | |
| *p_factor = 2088960; | |
| break; | |
| default: | |
| ret = DPS310_UNKNOWN_RATE_ERROR; | |
| } |
This leads to wrong results since the relevant parameter for deriving the scale factor is actually the oversampling rate (see Table 9 in the datasheet).
Metadata
Metadata
Assignees
Labels
No labels