Changeset 71 for webserver/example/EnergyMeters
- Timestamp:
- 10/19/10 20:56:18 (14 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/EnergyMeters.hzs
r70 r71 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" />24 <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;uIP Source" name="unnamed" />25 23 </Project> 26 24 <Register1> … … 42 40 <Watch1> 43 41 <Watches active="0" update="Three Seconds" > 42 <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" /> 44 45 <Watchpoint linenumber="64" radix="-1" name="currentTime" expression="currentTime" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 45 <Watchpoint linenumber="547" radix="16" name="PINSEL0" expression="PINSEL0" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />46 <Watchpoint evalMode="2" linenumber="72" numelements="10" evalType="0" radix="16" name="meterItems" expression="meterItems" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" />47 <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" />48 46 </Watches> 49 47 </Watch1> … … 58 56 <Watch4> 59 57 <Watches active="1" update="Twice a Second" > 60 <Watchpoint evalMode="2" linenumber="679" numelements="21" evalType="0" radix="-1" name="yield_day_rsp" expression="yield_day_rsp" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 61 <Watchpoint evalMode="2" linenumber="668" numelements="6" evalType="0" radix="16" name="dayRxYield" expression="dayRxYield" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 62 <Watchpoint evalMode="2" linenumber="669" numelements="100" evalType="0" radix="-1" name="rxUART3" expression="rxUART3" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 58 <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" /> 59 <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" /> 61 <Watchpoint linenumber="667" radix="16" name="rxYieldChkSum" expression="rxYieldChkSum" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 63 62 </Watches> 64 63 </Watch4> 65 64 <Files> 66 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x=" 40" debugPath="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" y="612" path="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" left="0" selected="1" name="unnamed" top="592" />67 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x=" 29" 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="51" />68 <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=" 0" name="unnamed" top="99" />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" /> 66 <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="99" /> 69 68 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" y="216" path="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" left="0" selected="0" name="unnamed" top="195" /> 70 69 <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" /> 71 70 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" y="1128" path="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" left="0" selected="0" name="unnamed" top="1104" /> 72 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x=" 21" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" y="286" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" left="0" selected="0" name="unnamed" top="278" />71 <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" /> 73 72 </Files> 74 73 <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/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c
r70 r71 285 285 } /* for */ 286 286 287 for (i = 0; i < NUMBER_OF_SOLAR_CHANNELS; i++) 288 { 289 sprintf( cCountBuf, "DAY %u %u\n", (int)i, dayRxYield[i] ); 290 strcat( uip_appdata, cCountBuf ); 291 } 292 287 288 sprintf( cCountBuf, "DAY %u %u %u\n", dayRxYield[0], dayRxYield[1], dayRxYield[2] ); 293 289 strcat( uip_appdata, cCountBuf ); 290 294 291 295 292 webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c
r70 r71 270 270 for (i = 0; i < NUMBER_OF_SOLAR_CHANNELS; i++) 271 271 { 272 dayRxYield[i] = 0;272 dayRxYield[i] = 65535; /* default: invalid/unset value */ 273 273 } /* for */ 274 274 … … 450 450 unsigned char power; /* variable for conversions */ 451 451 unsigned char checkDate; /* temp variable for day of month */ 452 452 unsigned char rxYieldChkSum; /* temp checksum for rx yield */ 453 453 454 454 /* always get Rx data */ … … 616 616 else if 617 617 ((scDate[1] == 1) || 618 (scDate[1] == 5) || 619 (scDate[1] == 7) || 620 (scDate[1] == 8) || 621 (scDate[1] == 10) || 622 (scDate[1] == 12)) 618 (scDate[1] == 1+1) || 619 (scDate[1] == 3+1) || 620 (scDate[1] == 5+1) || 621 (scDate[1] == 7+1) || 622 (scDate[1] == 8+1) || 623 (scDate[1] == 10+1)) 623 624 { 624 625 checkDate = 31; … … 660 661 if (cmpResult == 0) 661 662 { 662 /* we have got a match! */ 663 664 if (currentChannel <= 5) 663 /* we have got a match (i.e. expected frame received) ! */ 664 665 /* calculate the checksum of the received data */ 666 667 rxYieldChkSum = calculate_crc8( (&(rxUART3[0])), (sizeof(yield_day_rsp)-2)); 668 669 if (rxYieldChkSum == rxUART3[17]) 665 670 { 666 667 668 dayRxYield[currentChannel] = 669 extractBinaryHexDigitString( &(rxUART3[0]), 13, 16 ); 670 671 } /* if */ 671 /* checksum is correct! */ 672 673 if (currentChannel <= 5) 674 { 675 676 /* convert and copy value */ 677 dayRxYield[currentChannel] = 678 extractBinaryHexDigitString( &(rxUART3[0]), 13, 16 ); 679 680 } /* if */ 681 else 682 { 683 /* all channels done. nothing to do, we leave via SOL_QUERY_YIELD */ 684 } 685 } 686 else if (currentChannel <= 5) 687 { 688 /* valid channel index. but checksum is incorrect ! */ 689 dayRxYield[currentChannel] = 65535; /* invalid value */ 690 } 672 691 else 673 692 { 674 /* all channels done. nothing to do, we leave via SOL_QUERY_YIELD*/693 /* checksum incorrect and channel index out of range. do nothing. */ 675 694 } 676 695 696 /* always move on to the next value... */ 677 697 678 698 currentChannel++; /* increment channel counter so we query the next channel in the next round */