修复了气压传感器BUG:气压传感器的温度值引起的气压错误;将温度纳入错误判断规则,温度超范围算报错

This commit is contained in:
95384 2025-03-25 17:35:19 +08:00
parent 0aa2ed31e4
commit cc668ea478
2 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,7 @@ void Flash_EnableReadProtection(void)
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
///远程升级时读保护 ///远程升级时读保护
///Flash_EnableReadProtection();//¶Á±£»¤ // Flash_EnableReadProtection();//¶Á±£»¤
/* USER CODE END 1 */ /* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/ /* MCU Configuration--------------------------------------------------------*/

View File

@ -176,10 +176,12 @@ static HAL_StatusTypeDef MS56XX_GetPressureTemp(float *Temp, float *Press) //
if(MS56XX_Temperature<-6000) if(MS56XX_Temperature<-6000)
{ {
MS56XX_Temperature=-6000; MS56XX_Temperature=-6000;
return HAL_ERROR;
} }
if(MS56XX_Temperature>8500) if(MS56XX_Temperature>8500)
{ {
MS56XX_Temperature=8500; MS56XX_Temperature=8500;
return HAL_ERROR;
} }
if(Tmp_Pressure<1000) if(Tmp_Pressure<1000)
{ {