float32_t App_TempVirFind(float32_t f32NtcIndex, int32_t i32Code)
{
uint8_t u8Index;
uint32_t u32NtcIndex;
float32_t f32YLast;
float32_t f32VirTempIndex;
stc_line_func_cal_t stcLineFuncCal = {0};
u32NtcIndex = (uint32_t)(f32NtcIndex);
for(u8Index=0; u8Index < TEMPVIRDATALEN; u8Index++)
{
stcLineFuncCal.f32x1 = u32NtcIndex;
stcLineFuncCal.f32x2 = u32NtcIndex + 1;
stcLineFuncCal.f32y1 = i32TempVir[u32NtcIndex][u8Index];
stcLineFuncCal.f32y2 = i32TempVir[u32NtcIndex + 1][u8Index];
stcLineFuncCal.f32x = f32NtcIndex;
stcLineFuncCal.bPositive = TRUE;
_AppLineFunctionCal(&stcLineFuncCal);
if(i32Code <= stcLineFuncCal.f32y)
{
stcLineFuncCal.f32y1 = u8Index - 1;
stcLineFuncCal.f32y2 = u8Index;
stcLineFuncCal.f32x1 = f32YLast;
stcLineFuncCal.f32x2 = stcLineFuncCal.f32y;
stcLineFuncCal.f32x = i32Code;
stcLineFuncCal.bPositive = TRUE;
_AppLineFunctionCal(&stcLineFuncCal);
f32VirTempIndex = stcLineFuncCal.f32y;
break;
}
else
{
f32YLast = stcLineFuncCal.f32y;
}
}
return (((f32VirTempIndex*10)/2) + 100);
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/122264.html
標籤:C語言
上一篇:c語言初學者,求大佬指點
下一篇:這道題咋寫啊?求助!!!!
