修复了气压传感器BUG:气压传感器的温度值引起的气压错误;将温度纳入错误判断规则,温度超范围算报错
This commit is contained in:
parent
0aa2ed31e4
commit
cc668ea478
|
@ -128,7 +128,7 @@ void Flash_EnableReadProtection(void)
|
|||
|
||||
/* USER CODE BEGIN 1 */
|
||||
///远程升级时读保护
|
||||
///Flash_EnableReadProtection();//¶Á±£»¤
|
||||
// Flash_EnableReadProtection();//¶Á±£»¤
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/* MCU Configuration--------------------------------------------------------*/
|
||||
|
|
|
@ -176,10 +176,12 @@ static HAL_StatusTypeDef MS56XX_GetPressureTemp(float *Temp, float *Press) //
|
|||
if(MS56XX_Temperature<-6000)
|
||||
{
|
||||
MS56XX_Temperature=-6000;
|
||||
return HAL_ERROR;
|
||||
}
|
||||
if(MS56XX_Temperature>8500)
|
||||
{
|
||||
MS56XX_Temperature=8500;
|
||||
return HAL_ERROR;
|
||||
}
|
||||
if(Tmp_Pressure<1000)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue