Home > Back-end >  Please pay attention to this piece of code
Please pay attention to this piece of code

Time:10-09


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 {
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;
}
The else
{
F32YLast=stcLineFuncCal. F32y;

}

}

Return (((f32VirTempIndex * 10)/2) + 100);
  • Related