измерение температуры по прерываниям на gpio15
This commit is contained in:
parent
f9017a881d
commit
d888b2bebd
@ -85,10 +85,6 @@ void InitPerif(void)
|
||||
temperatureInit();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Enable global Interrupts and higher priority real-time debug events:
|
||||
//
|
||||
|
||||
@ -9,16 +9,14 @@
|
||||
|
||||
|
||||
uint16_t TemperatureImpCount = 0;
|
||||
uint16_t TemperaturePause = 0;
|
||||
uint16_t TemperatureLine = 0;
|
||||
uint16_t TemperatureMaxPause = 0; //16ms
|
||||
uint16_t Temperature = 0;
|
||||
uint16_t TemperatureInitDone = 0;
|
||||
|
||||
|
||||
uint16_t temperatureTic[3] = {0,0,0};
|
||||
uint16_t Temperature_TimeMax = 160; //16mS
|
||||
|
||||
__interrupt void temperature_isr(void)
|
||||
{
|
||||
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
|
||||
TemperatureImpCount++;
|
||||
}
|
||||
|
||||
@ -34,7 +32,19 @@ uint16_t temperature_calc(uint16_t Imp)
|
||||
|
||||
void temperatureTest(void)
|
||||
{
|
||||
temperatureTic[0] = TemperatureImpCount;
|
||||
if(temperatureTic[0] != 0)
|
||||
{
|
||||
if(temperatureTic[1] == temperatureTic[0]) temperatureTic[2]++;
|
||||
else temperatureTic[2] = 0;
|
||||
temperatureTic[1] = temperatureTic[0];
|
||||
|
||||
if(temperatureTic[2] > Temperature_TimeMax)
|
||||
{
|
||||
Temperature = ((temperatureTic[0]-1)>>4) - 50;
|
||||
temperatureTic[1] = TemperatureImpCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
|
||||
<configuration XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS2xx USB Debug Probe_0" href="connections/TIXDS2XXUSB_Connection.xml" id="Texas Instruments XDS2xx USB Debug Probe_0" xml="TIXDS2XXUSB_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
|
||||
<instance XML_version="1.2" href="drivers/tixds560icepick_c.xml" id="drivers" xml="tixds560icepick_c.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560c28x.xml" id="drivers" xml="tixds560c28x.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cla2.xml" id="drivers" xml="tixds560cla2.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cs_child.xml" id="drivers" xml="tixds560cs_child.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cs_dap.xml" id="drivers" xml="tixds560cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560cortexM.xml" id="drivers" xml="tixds560cortexM.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds560ajsm.xml" id="drivers" xml="tixds560ajsm.xml" xmlpath="drivers"/>
|
||||
<configuration XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS100v2 USB Debug Probe_0" href="connections/TIXDS100v2_Connection.xml" id="Texas Instruments XDS100v2 USB Debug Probe_0" xml="TIXDS100v2_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS100v2 USB Debug Probe_0">
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2c28x.xml" id="drivers" xml="tixds100v2c28x.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cla2.xml" id="drivers" xml="tixds100v2cla2.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_child.xml" id="drivers" xml="tixds100v2cs_child.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds510ajsm.xml" id="drivers" xml="tixds510ajsm.xml" xmlpath="drivers"/>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="TMS320F28388D_0" href="devices/f28388d.xml" id="TMS320F28388D_0" xml="f28388d.xml" xmlpath="devices"/>
|
||||
<device HW_revision="1" XML_version="1.2" description="" id="TMS320F28388D_0" partnum="TMS320F28388D">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user