220Vheat80Gear

增加水平回零角度显示异常处理
This commit is contained in:
REASEARCHER\18383 2025-09-03 11:41:18 +08:00
parent b9c7ebb4fc
commit cfb888ee99
1 changed files with 18 additions and 10 deletions

View File

@ -2882,18 +2882,26 @@ static char ptz_hori_get_angle_a()
// tem4 = tem4 + 360.0;
// }
}
//避免出现异常
for(uint8_t i = 0; i < 3; i++)
{
if(tem4 == 360.0)///////解决既显示360又显示角度0的问题
{
tem4 = 0;
}
if(tem4 < 0)
else if( tem4 < 0 )
{
tem4 = tem4 + 360.0;
}
if(tem4>360.0)
else if( tem4 > 360.0 )
{
tem4 = tem4 - 360.0;
}
if (tem4 >=0 && tem4 <= 360.0)
{
break;
}
}
g_ptz.hori_angle_actual = tem4;