/*********************************************************************
?* @fn ? ? ?TempSensor_Volt_To_Temper
?*
?* @brief ? Internal Temperature Sensor Voltage to temperature.
?*
?* @param ? Value - Voltage Value(mv).
?*
?* @return ?Temper - Temperature Value.
?*/
s32 TempSensor_Volt_To_Temper(s32 Value)
{
? ? s32 Temper, Refer_Volt, Refer_Temper;
? ? s32 k = 43;
? ? Refer_Volt = (s32)((*(u32 *)0x1FFFF720) & 0x0000FFFF);
? ? Refer_Temper = (s32)(((*(u32 *)0x1FFFF720) >> 16) & 0x0000FFFF);
? ? Temper = Refer_Temper - ((Value - Refer_Volt) * 10 + (k >> 1)) / k;
? ? return Temper;
}
這個讀取單片機內(nèi)部溫度,執(zhí)行上感覺太耗時了,這個能再優(yōu)化一下嗎?