/* Calculates a scaled and compensated pressure value from raw data raw: raw pressure value read from Dps310 returns: pressure value in Pa  */
int32_t calcPressure(int32_t raw)
/* Calculates a scaled and compensated pressure value from raw data raw: raw pressure value read from Dps310 returns: pressure value in Pa  */
int32_t calcPressure(int32_t raw)
{
    double prs = raw;
    prs /= scaling_facts[dps310_ctx.m_prsOsr];
    prs =
      dps310_ctx.m_c00 +
      prs *
        (dps310_ctx.m_c10 + prs * (dps310_ctx.m_c20 + prs * dps310_ctx.m_c30)) +
      dps310_ctx.m_lastTempScal *
        (dps310_ctx.m_c01 + prs * (dps310_ctx.m_c11 + prs * dps310_ctx.m_c21));
    return (int32_t)prs;
}