Changeset 72 for webserver/example
- Timestamp:
- 10/23/10 12:36:15 (14 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/EnergyMeters.hzs
r71 r72 21 21 <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;Demo Source" name="unnamed" /> 22 22 <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;EnergyMeters" name="unnamed" /> 23 <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;FreeRTOS.org Source" name="unnamed" /> 23 24 </Project> 24 25 <Register1> … … 40 41 <Watch1> 41 42 <Watches active="0" update="Three Seconds" > 43 <Watchpoint linenumber="64" radix="-1" name="currentTime" expression="currentTime" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 44 <Watchpoint linenumber="547" radix="16" name="PINSEL0" expression="PINSEL0" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 45 <Watchpoint evalMode="2" linenumber="72" numelements="10" evalType="0" radix="16" name="meterItems" expression="meterItems" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 42 46 <Watchpoint evalMode="2" linenumber="312" numelements="10" evalType="0" radix="16" name="rxUART3" expression="rxUART3" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 43 <Watchpoint evalMode="2" linenumber="72" numelements="10" evalType="0" radix="16" name="meterItems" expression="meterItems" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" />44 <Watchpoint linenumber="547" radix="16" name="PINSEL0" expression="PINSEL0" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />45 <Watchpoint linenumber="64" radix="-1" name="currentTime" expression="currentTime" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" />46 47 </Watches> 47 48 </Watch1> … … 55 56 </Watch3> 56 57 <Watch4> 57 <Watches active="1" update="Twice a Second" > 58 <Watches active="1" update="Each Second" > 59 <Watchpoint linenumber="1231" radix="16" name="currentCha" expression="currentCha" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 60 <Watchpoint linenumber="1214" radix="-1" name="lastSrcByte" expression="lastSrcByte" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 58 61 <Watchpoint evalMode="2" linenumber="677" numelements="6" evalType="0" radix="16" name="dayRxYield" expression="dayRxYield" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 62 <Watchpoint linenumber="1231" radix="16" name="currentCharValue" expression="currentCharValue" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 59 63 <Watchpoint evalMode="2" linenumber="678" numelements="100" evalType="0" radix="-1" name="rxUART3" expression="rxUART3" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 60 <Watchpoint evalMode=" 2" linenumber="699" numelements="21" evalType="0" radix="-1" name="yield_day_rsp" expression="yield_day_rsp" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />64 <Watchpoint evalMode="1" linenumber="1231" evalType="1" radix="-1" name="srcDataStart" expression="srcDataStart" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 61 65 <Watchpoint linenumber="667" radix="16" name="rxYieldChkSum" expression="rxYieldChkSum" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 66 <Watchpoint linenumber="673" radix="-1" name="currentChannel" expression="currentChannel" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 67 <Watchpoint evalMode="2" linenumber="1290" numelements="13" evalType="0" radix="-1" name="req_day_yield" expression="req_day_yield" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 62 68 </Watches> 63 69 </Watch4> 64 70 <Files> 65 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" y=" 662" path="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" left="0" selected="0" name="unnamed" top="637" />71 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" y="1216" path="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" left="0" selected="0" name="unnamed" top="1205" /> 66 72 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\MetersIncludes.h" y="36" path="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\MetersIncludes.h" left="0" selected="0" name="unnamed" top="11" /> 67 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" y="115" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" left="0" selected="1" name="unnamed" top="9 9" />68 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" y="2 16" path="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" left="0" selected="0" name="unnamed" top="195" />73 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" y="115" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" left="0" selected="1" name="unnamed" top="97" /> 74 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" y="220" path="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" left="0" selected="0" name="unnamed" top="195" /> 69 75 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\queue.c" y="799" path="D:\repo\webserver\example\EnergyMeters\Source\queue.c" left="0" selected="0" name="unnamed" top="781" /> 70 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" y="1 128" path="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" left="0" selected="0" name="unnamed" top="1104" />76 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" y="1897" path="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" left="0" selected="0" name="unnamed" top="1879" /> 71 77 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" y="287" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" left="0" selected="0" name="unnamed" top="269" /> 78 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="2" debugPath="D:\repo\webserver\example\EnergyMeters\Source\serial.c" y="225" path="D:\repo\webserver\example\EnergyMeters\Source\serial.c" left="0" selected="0" name="unnamed" top="209" /> 72 79 </Files> 73 80 <ARMCrossStudioWindow activeProject="EnergyMetersEmbedded" autoConnectTarget="Segger J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388479" debugSearchPath="" buildConfiguration="ARM Flash Debug" /> webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c
r71 r72 929 929 { 930 930 931 unsigned int baud = 57600;931 unsigned int baud = 2400; 932 932 unsigned int divisor = get_uart_clk(3, OSCILLATOR_CLOCK_FREQUENCY) / (16 * baud); 933 933 … … 1203 1203 ) 1204 1204 { 1205 unsigned char currentChar; 1206 unsigned char conversionError = 0; 1205 1207 1206 1208 unsigned char x; 1207 1209 int resultValue = 0; /* initial value */ 1208 1210 unsigned char round = 0; /* which digit? 0 = LSB */ 1209 unsigned charcurrentCharValue;1211 int currentCharValue; 1210 1212 1211 1213 /* go through the bytes backwards (least significant to most significant) */ 1212 1214 for (x = lastSrcByte; x >= firstSrcByte; x--) 1213 1215 { 1214 1215 currentCharValue = (srcDataStart[x]) - 0x30; 1216 currentChar = srcDataStart[x]; 1217 if ((currentChar < 0x30) || (currentChar > 0x46)) 1218 { 1219 conversionError = 1; 1220 } 1221 else if (currentChar <= 0x39) 1222 { 1223 // 0x0 to 0x9 1224 currentCharValue = (srcDataStart[x]) - 0x30; 1225 } 1226 else 1227 { 1228 // 0xA to 0xF 1229 currentCharValue = 0xA + ((srcDataStart[x]) - 0x41); 1230 } 1216 1231 resultValue = resultValue + (currentCharValue << (4 * round)); 1217 1232 1218 1233 round++; 1219 1234 } /* for */ 1235 1236 /* if a conversion error occurred, nullify the result */ 1237 if (conversionError == 1) 1238 { 1239 resultValue = 0xFFFF; 1240 } 1220 1241 1221 1242 return resultValue; webserver/example/EnergyMeters/Source/serial.c
r37 r72 224 224 225 225 226 unsigned int baud = 57600;226 unsigned int baud = 2400; 227 227 unsigned int divisor = get_uart_clk(3, OSCILLATOR_CLOCK_FREQUENCY) / (16 * baud); 228 228