zhyinch
2021-10-22 2eeb6bd4fbcb8fc684f022f411b49bffb45671f1
Src/ExternalDevices/dps310.c
@@ -7,7 +7,7 @@
 */
#include "dps310.h"
#include "main.h"
/* Meaningful Default Configuration */
#define     IFX_DPS310_TEMPERATURE_OSR                  OSR_2
#define     IFX_DPS310_PRESSURE_OSR                     OSR_64
@@ -267,7 +267,7 @@
        if (ret < IFX_DPS310_PSR_TMP_READ_LEN)
            return -EINVAL;
HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_RESET);
        press_raw = (read_buffer[2]) + (read_buffer[1]<<8) + (read_buffer[0] <<16);
        temp_raw  = (read_buffer[5]) + (read_buffer[4]<<8) + (read_buffer[3] <<16);
@@ -291,7 +291,7 @@
                      temp_scaled * drv_state->calib_coeffs.C01 +
                      temp_scaled * press_scaled * ( drv_state->calib_coeffs.C11 +
                                                      press_scaled * drv_state->calib_coeffs.C21 );
HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_SET);
        press_final = press_final * 0.01f;   //to convert it into mBar
        *temperature = temp_final;