Changeset 68 for webserver/example

Show
Ignore:
Timestamp:
09/12/10 19:33:03 (14 years ago)
Author:
phil
Message:

query time once per minute now works.
more detailled output on FSM stuck error.
FSM needs redesign, search for "duplicate".

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/EnergyMeters.hzp

    r37 r68  
    5656      <file file_name="../../Source/serial.c"/> 
    5757    </folder> 
    58     <configuration Name="ARM Flash Debug" arm_target_flash_loader_type="LIBMEM RPC Loader" c_enforce_ansi_checking="No" c_preprocessor_definitions="" gcc_optimization_level="None" linker_keep_symbols="_vectors" linker_printf_fmt_level="int" linker_scanf_character_group_matching_enabled="No" linker_scanf_fmt_level="int"/> 
     58    <configuration Name="ARM Flash Debug" arm_target_flash_loader_type="LIBMEM RPC Loader" c_enforce_ansi_checking="No" c_preprocessor_definitions="" gcc_optimization_level="None" link_use_multi_threaded_libraries="No" linker_keep_symbols="_vectors" linker_printf_fmt_level="int" linker_scanf_character_group_matching_enabled="No" linker_scanf_fmt_level="int"/> 
    5959    <folder Name="uIP Source"> 
    6060      <file Name="uIP_Task.c" file_name="webserver/uIP_Task.c"> 
     
    8787    </folder> 
    8888    <configuration Name="THUMB" c_preprocessor_definitions="THUMB_INTERWORK"/> 
    89     <configuration Name="ARM Flash Release" c_preprocessor_definitions="STARTUP_FROM_RESET" gcc_optimization_level="Optimize For Size"/> 
     89    <configuration Name="ARM Flash Release" c_preprocessor_definitions="STARTUP_FROM_RESET" gcc_optimization_level="Optimize For Size" link_use_multi_threaded_libraries="No"/> 
    9090    <configuration Name="THUMB Flash Debug" arm_linker_fiq_stack_size="0" arm_linker_heap_size="0" arm_linker_stack_size="0" arm_linker_svc_stack_size="512"/> 
    9191    <folder Name="EnergyMeters"> 
  • webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/EnergyMeters.hzs

    r53 r68  
    1919  <ProjectSessionItem path="EnergyMetersEmbedded" name="unnamed" /> 
    2020  <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded" name="unnamed" /> 
    21   <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;Demo Source" name="unnamed" /> 
    2221  <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;EnergyMeters" name="unnamed" /> 
    2322 </Project> 
     
    4039 <Watch1> 
    4140  <Watches active="0" update="Three Seconds" > 
     41   <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" /> 
     42   <Watchpoint evalMode="2" linenumber="72" numelements="10" evalType="0" radix="16" name="meterItems" expression="meterItems" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 
     43   <Watchpoint linenumber="64" radix="-1" name="currentTime" expression="currentTime" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 
    4244   <Watchpoint linenumber="547" radix="16" name="PINSEL0" expression="PINSEL0" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    43    <Watchpoint linenumber="64" radix="-1" name="currentTime" expression="currentTime" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 
    44    <Watchpoint evalMode="2" linenumber="72" numelements="10" evalType="0" radix="16" name="meterItems" expression="meterItems" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 
    45    <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" /> 
    4645  </Watches> 
    4746 </Watch1> 
     
    5655 <Watch4> 
    5756  <Watches active="1" update="Twice a Second" > 
     57   <Watchpoint linenumber="948" radix="-1" name="carry" expression="carry" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     58   <Watchpoint evalMode="2" linenumber="111" numelements="11" evalType="0" radix="-1" name="meterItems" expression="meterItems" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/meters_isrs.c" /> 
     59   <Watchpoint linenumber="951" radix="-1" name="crcCHAR" expression="crcCHAR" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     60   <Watchpoint linenumber="381" radix="-1" name="cmpResult" expression="cmpResult" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     61   <Watchpoint linenumber="981" radix="-1" name="cmpValue" expression="cmpValue" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     62   <Watchpoint linenumber="940" radix="-1" name="crcLONG" expression="crcLONG" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     63   <Watchpoint linenumber="637" radix="-1" name="ch" expression="ch" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    5864   <Watchpoint evalMode="2" linenumber="539" numelements="100" evalType="0" radix="-1" name="rxUART3" expression="rxUART3" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    59    <Watchpoint linenumber="53" radix="16" name="currentChannel" expression="currentChannel" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    60    <Watchpoint evalMode="2" linenumber="488" numelements="6" evalType="0" radix="-1" name="chanWatt" expression="chanWatt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     65   <Watchpoint linenumber="573" radix="-1" name="xLastSolarStateChangeTime" expression="xLastSolarStateChangeTime" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     66   <Watchpoint evalMode="2" linenumber="488" numelements="6" evalType="0" radix="10" name="chanWatt" expression="chanWatt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     67   <Watchpoint evalMode="2" linenumber="485" numelements="6" evalType="0" radix="10" name="scDate" expression="scDate" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    6168   <Watchpoint evalMode="2" linenumber="488" numelements="6" evalType="0" radix="11" name="chanVolt" expression="chanVolt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    6269   <Watchpoint evalMode="0" linenumber="396" evalType="1" radix="-1" name="uip_appdata" expression="uip_appdata" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
    63    <Watchpoint evalMode="2" linenumber="111" numelements="11" evalType="0" radix="-1" name="meterItems" expression="meterItems" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/meters_isrs.c" /> 
     70   <Watchpoint linenumber="951" radix="-1" name="crcCHARinv" expression="crcCHARinv" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    6471   <Watchpoint linenumber="109" radix="16" name="solarReadErrors" expression="solarReadErrors" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     72   <Watchpoint linenumber="969" radix="-1" name="staticCRC" expression="staticCRC" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    6573   <Watchpoint linenumber="55" radix="16" name="solarState" expression="solarState" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    66    <Watchpoint linenumber="223" radix="16" name="filename" expression="filename" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd.c" /> 
    67    <Watchpoint linenumber="637" radix="-1" name="ch" expression="ch" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    68    <Watchpoint linenumber="216" radix="16" name="RxBuf" expression="RxBuf" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    69    <Watchpoint evalMode="0" linenumber="396" evalType="1" radix="16" name="uip_appdata" expression="uip_appdata" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
    70    <Watchpoint linenumber="205" radix="-1" name="byteReceived" expression="byteReceived" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    71    <Watchpoint evalMode="1" linenumber="607" evalType="1" radix="-1" name="data" expression="data" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    72    <Watchpoint linenumber="235" radix="-1" name="cRxedChar" expression="cRxedChar" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/common/full/comtest.c" /> 
    73    <Watchpoint linenumber="245" radix="16" name="METER_INDEX_GAS" expression="METER_INDEX_GAS" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
     74   <Watchpoint evalMode="0" linenumber="428" evalType="0" radix="-1" name="init1" expression="init1" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     75   <Watchpoint linenumber="676" radix="-1" name="xLastTimeCheckTime" expression="xLastTimeCheckTime" filename="d:/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     76   <Watchpoint evalMode="0" linenumber="396" evalType="1" radix="-1" name="uip_appdata" expression="uip_appdata" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
    7477  </Watches> 
    7578 </Watch4> 
    7679 <Files> 
    77   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="4" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters.c" y="75" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters.c" left="0" selected="1" name="unnamed" top="59" /> 
    78   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="17" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" y="278" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" left="0" selected="0" name="unnamed" top="267" /> 
    79   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\MetersIncludes.h" y="9" path="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\MetersIncludes.h" left="0" selected="0" name="unnamed" top="15" /> 
    80   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\Meters_ISRs.c" y="93" path="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\Meters_ISRs.c" left="0" selected="0" name="unnamed" top="51" /> 
    81   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="4" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\timeConversion.c" y="33" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\timeConversion.c" left="0" selected="0" name="unnamed" top="0" /> 
    82   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" y="277" path="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" left="0" selected="0" name="unnamed" top="262" /> 
    83   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\LCD\portlcd.c" y="279" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\LCD\portlcd.c" left="0" selected="0" name="unnamed" top="264" /> 
    84   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\tasks.c" y="1072" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\tasks.c" left="0" selected="0" name="unnamed" top="1060" /> 
    85   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" y="82" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" left="0" selected="0" name="unnamed" top="62" /> 
    86   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\FreeRTOS.h" y="251" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\FreeRTOS.h" left="0" selected="0" name="unnamed" top="241" /> 
    87   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\Minimal\flash.c" y="164" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\Minimal\flash.c" left="0" selected="0" name="unnamed" top="148" /> 
    88   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" y="290" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" left="0" selected="0" name="unnamed" top="260" /> 
    89   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uip_arp.c" y="114" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uip_arp.c" left="0" selected="0" name="unnamed" top="99" /> 
    90   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uipopt.h" y="348" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uipopt.h" left="0" selected="0" name="unnamed" top="333" /> 
    91   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\uip-conf.h" y="0" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\uip-conf.h" left="0" selected="0" name="unnamed" top="127" /> 
    92   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="16" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\targets\LPC23xx.h" y="817" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\targets\LPC23xx.h" left="0" selected="0" name="unnamed" top="799" /> 
     80  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" y="278" path="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" left="0" selected="0" name="unnamed" top="261" /> 
     81  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" y="1133" path="D:\repo\webserver\example\EnergyMeters\Source\tasks.c" left="0" selected="0" name="unnamed" top="1105" /> 
     82  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd.c" y="9" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd.c" left="0" selected="0" name="unnamed" top="0" /> 
     83  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\LCD\portlcd.c" y="24" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\LCD\portlcd.c" left="0" selected="0" name="unnamed" top="9" /> 
     84  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\port.c" y="172" path="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\port.c" left="0" selected="0" name="unnamed" top="152" /> 
     85  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\MetersIncludes.h" y="0" path="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\MetersIncludes.h" left="0" selected="0" name="unnamed" top="21" /> 
     86  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\list.c" y="108" path="D:\repo\webserver\example\EnergyMeters\Source\list.c" left="0" selected="0" name="unnamed" top="89" /> 
     87  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\include\portable.h" y="105" path="D:\repo\webserver\example\EnergyMeters\Source\include\portable.h" left="0" selected="0" name="unnamed" top="89" /> 
     88  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portmacro.h" y="0" path="D:\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portmacro.h" left="0" selected="0" name="unnamed" top="75" /> 
     89  <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" /> 
     90  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" y="0" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" left="0" selected="0" name="unnamed" top="114" /> 
     91  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="29" debugPath="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" y="565" path="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" left="0" selected="1" name="unnamed" top="582" /> 
     92  <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="26" /> 
     93  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\queue.c" y="132" path="D:\repo\webserver\example\EnergyMeters\Source\queue.c" left="0" selected="0" name="unnamed" top="132" /> 
     94  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\serial.c" y="226" path="D:\repo\webserver\example\EnergyMeters\Source\serial.c" left="0" selected="0" name="unnamed" top="210" /> 
     95  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\LPC230x.c" y="69" path="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\LPC230x.c" left="0" selected="0" name="unnamed" top="53" /> 
     96  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters_ISRs.c" y="12" path="D:\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters_ISRs.c" left="0" selected="0" name="unnamed" top="0" /> 
     97  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\Source\include\FreeRTOS.h" y="367" path="D:\repo\webserver\example\EnergyMeters\Source\include\FreeRTOS.h" left="0" selected="0" name="unnamed" top="353" /> 
     98  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" y="81" path="D:\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" left="0" selected="0" name="unnamed" top="63" /> 
    9399 </Files> 
    94100 <ARMCrossStudioWindow activeProject="EnergyMetersEmbedded" autoConnectTarget="Macraigor Wiggler (20 Pin)" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388479" debugSearchPath="" buildConfiguration="ARM Flash Release" /> 
  • webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c

    r67 r68  
    6464extern unsigned long correctVoltWattRx; 
    6565extern unsigned long failedVoltWattRx; 
     66extern unsigned long queryTimeCounter; 
    6667extern unsigned char chanVolt[6]; /* holds the voltages measured on channel 0 to 5 */ 
    6768extern int chanWatt[6]; /* holds the wattages measured on channel 0 to 5 */ 
     
    6970extern int solarReadCounter; 
    7071extern unsigned char scDate[6]; /* date received from solar count */ 
     72 
     73extern int solarStateWhenFail; 
     74extern int currentChannelWhenFail; 
    7175 
    7276HTTPD_CGI_CALL(file, "file-stats", file_stats); 
     
    232236        lRefreshCount++; 
    233237        sprintf( cCountBuf, "<h2>\r\n<p><br>Refresh count = %d\r\nVoltages %d %d %d %d\r\n\ 
    234 Wattages %d %d %d %d\r\nSolarReadErr %u\r\nSolarReadCount %u\r\nCurrentTime %u\r\n</h2>\r\n", lRefreshCount, 
     238Wattages %d %d %d %d\r\nSolarReadErr %u\r\nSolarReadCount %u\r\nCurrentTime %u</h2>\r\n", lRefreshCount, 
    235239         chanVolt[0], chanVolt[1], chanVolt[2], chanVolt[3], 
    236240         chanWatt[0], chanWatt[1], chanWatt[2], chanWatt[3], 
     
    249253 
    250254 
    251         sprintf( cCountBuf, "<h2>Watt_CRCok=%u\r\nWatt_CRCfail=%u\r\nSC_Date=20%02d-%02d-%02d_%02d:%02d</h2>", 
    252           correctVoltWattRx, failedVoltWattRx, scDate[0], scDate[1], scDate[2], scDate[3], scDate[4] 
     255        sprintf( cCountBuf, "<h2>Watt_CRCok=%u\r\nWatt_CRCfail=%u\r\nSC_Date=20%02d-%02d-%02d_%02d:%02d\r\nTimeQueries %d\r\nStateWhenFail=%u , chanWhenFail=%u</h2>", 
     256          correctVoltWattRx, failedVoltWattRx, scDate[0], scDate[1], scDate[2], scDate[3], scDate[4], queryTimeCounter, solarStateWhenFail, currentChannelWhenFail 
    253257         ); 
    254258        strcat( uip_appdata, cCountBuf ); 
  • webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c

    r67 r68  
    2323#define SOLAR_FSM_STUCK_TIMEOUT  2000 
    2424 
     25/* how often (in ms) do we query the timer? */ 
     26#define SOLAR_TIME_CHECK_INTERVAL (60 * 1000) 
     27 
     28 
    2529/* means "unknown value", converted to "U" on rrdtool script side */ 
    2630#define SOLAR_FSM_INVALID_VALUE  0x4000 /* 16384 */ 
     
    3438unsigned long correctVoltWattRx = 0; /* counter of correctly received wattage/voltage packets */ 
    3539unsigned long failedVoltWattRx = 0;  /* counter of incorrectly received wattage/voltage packets */ 
    36  
     40unsigned long queryTimeCounter = 0;  /* counter attempted queries for the time */ 
    3741 
    3842static unsigned short staticCRC; 
     
    8185unsigned char currentChannel; /* the SolarCount channel we currently query (here: 0 to 3) */ 
    8286 
    83 static int solarState = SOL_NO_INIT; /* state of the SolarCount communication state machine */ 
     87static int solarState = SOL_QUERY_TIME; /* state of the SolarCount communication state machine */ 
    8488 
    8589 
     
    140144portTickType xLastSolarStateChangeTime; 
    141145 
     146portTickType xLastTimeCheckTime; 
     147 
     148 
    142149 /* time when the elements of the history array were last moved on one step */ 
    143150portTickType xLastSolarHistoryAdvance; 
     
    148155 
    149156int solarReadCounter = 0; 
     157 
     158 
     159int solarStateWhenFail = 0xFF; 
     160int currentChannelWhenFail = 0xFF; 
    150161 
    151162/* pototype  section */ 
     
    181192  int i; 
    182193  xLastSolarStateChangeTime = xTaskGetTickCount(); 
     194  xLastTimeCheckTime = xTaskGetTickCount(); 
    183195  xLastReadTime = xTaskGetTickCount(); 
    184   solarState = SOL_NO_INIT
     196  solarState = SOL_QUERY_TIME
    185197  uart3TxRunning = 0; /* reset flag to tell if we are currently sending a datagram */ 
    186198  rxBuf3NextFreeRxPos = 0; 
     
    374386 
    375387  /* did the SolarFSM get stuck during reading? */ 
    376   if (xTaskGetTickCount() > xLastSolarStateChangeTime + SOLAR_FSM_STUCK_TIMEOUT
    377   { 
    378     /* something has gone wrong (possible Rx Timeout). restart, state SOL_NO_INIT */ 
     388  if (xTaskGetTickCount() > (xLastSolarStateChangeTime + SOLAR_FSM_STUCK_TIMEOUT)
     389  { 
     390    /* something has gone wrong (possible Rx Timeout). restart, state SOL_QUERY_TIME */ 
    379391    xLastSolarStateChangeTime = xTaskGetTickCount(); 
     392 
     393    /* save error info */ 
     394    solarStateWhenFail = solarState; 
     395    currentChannelWhenFail = currentChannel; 
     396     
    380397    initSolarFSM(); 
    381398    solarReadErrors++; 
     399 
    382400  } 
    383401  else if (xTaskGetTickCount() < xLastSolarStateChangeTime) 
     
    429447      /* now ready to query channel 0 data in next state */ 
    430448      xLastSolarStateChangeTime = xTaskGetTickCount(); 
    431       solarState = SOL_QUERY_TIME
     449      solarState = SOL_CHAN
    432450    } 
    433451    else 
     
    441459 
    442460      resetUart3RxBuf(); /* init */ 
    443       currentChannel = 0; /* the channel we query first */ 
    444461 
    445462       /* send query_sc_time */ 
    446463      send_uart3((unsigned char *)query_sc_time, sizeof(query_sc_time)); 
    447464      xLastSolarStateChangeTime = xTaskGetTickCount(); 
     465      queryTimeCounter++; 
    448466      solarState = SOL_WAIT_FOR_TIME_RSP; /* query sent wait for response */ 
    449467    break; 
     
    456474      if (cmpResult == 0) 
    457475      { 
    458         /* we have got a match! */ 
     476          /* we have got a match! */ 
    459477         
    460478          if (checkRxTwoByteCheckSum(1, 10, 11) == 1) /* checksum in bytes 11 and 12, check bytes 1 to 10 */ 
     
    472490          else 
    473491          { 
    474            
     492            /* time rx checksum error */
    475493          } 
    476494 
     
    478496        resetUart3RxBuf(); 
    479497 
    480  
    481         solarState = SOL_CHAN; /* change state: time response received, now query the channels */ 
     498        xLastSolarStateChangeTime = xTaskGetTickCount(); 
     499        solarState = SOL_NO_INIT; /* change state: time response received, now init and query the channels */ 
    482500      } 
    483501      else 
     
    517535        xLastSolarStateChangeTime = xTaskGetTickCount(); 
    518536        solarState = SOL_FINISHED; 
     537        currentChannel = 0; 
     538 
     539        /* new duplicated code: */ 
     540 
     541        resetUart3RxBuf(); 
     542 
     543 
     544        if (xTaskGetTickCount() > (xLastTimeCheckTime + SOLAR_TIME_CHECK_INTERVAL)) 
     545        { 
     546           /* time to get the time info again! */ 
     547           xLastTimeCheckTime = xTaskGetTickCount(); 
     548           solarState = SOL_QUERY_TIME; /* restart the measurement cycle (with time check at first) */ 
     549        } 
     550        else if (xTaskGetTickCount() < xLastTimeCheckTime) 
     551        { 
     552          /* overflow of timer, just recover. delay will be wrong. */ 
     553          xLastTimeCheckTime = xTaskGetTickCount(); 
     554          solarState = SOL_NO_INIT; /* restart the measurement cycle (without time check at first) */ 
     555        } 
     556        else 
     557        { 
     558          /* not time to get the time info. leave state at SOL_FINISHED. */ 
     559        } 
     560 
     561 
     562 
    519563        break; 
    520564      default: 
    521         ; /* do nothing */ 
     565        currentChannel = 0; /* current channel not 0 to 6, reset it. */ 
     566       /* nothing else to do */ 
     567 
    522568     } /* switch */ 
    523      if (solarState != SOL_FINISHED
     569     if ((solarState != SOL_FINISHED) && (solarState != SOL_QUERY_TIME)
    524570     { 
    525      xLastSolarStateChangeTime = xTaskGetTickCount(); 
     571      xLastSolarStateChangeTime = xTaskGetTickCount(); 
    526572      solarState = SOL_CHAN_WAIT_REPLY; /* wait for reply if not finished */ 
    527573     } /* if */ 
     
    552598         case 6: 
    553599          /* wait for the response to the finishing init */ 
    554           cmpResult = checkUart3Received(init_after_all_chan_rsp, init_after_all_chan_r_m,  sizeof(init_after_all_chan_rsp)-1); 
     600          // cmpResult = checkUart3Received(init_after_all_chan_rsp, init_after_all_chan_r_m,  sizeof(init_after_all_chan_rsp)-1); 
    555601          break; 
    556602        default: 
     
    601647          /* switch to next channel */ 
    602648          currentChannel++; 
     649 
     650          /* finally, discard data from buffer */ 
     651          resetUart3RxBuf(); 
     652 
    603653          /* now ready to query channel data for next channel */ 
    604654          xLastSolarStateChangeTime = xTaskGetTickCount(); 
     
    607657        else 
    608658        { 
     659 
     660          /* I think we never go here ... */ 
     661 
    609662          /* we received the finishing sequence */ 
    610663          xLastSolarStateChangeTime = xTaskGetTickCount(); 
    611           solarState = SOL_NO_INIT; /* restart the measurement cycle */ 
    612         } 
    613  
    614         resetUart3RxBuf(); 
     664 
     665          resetUart3RxBuf(); 
     666 
     667          // may be duplicated 
     668          if (xTaskGetTickCount() > (xLastTimeCheckTime + SOLAR_TIME_CHECK_INTERVAL)) 
     669          { 
     670            /* time to get the time info again! */ 
     671            xLastTimeCheckTime = xTaskGetTickCount(); 
     672            solarState = SOL_QUERY_TIME; /* restart the measurement cycle (with time check at first) */ 
     673          } 
     674          else if (xTaskGetTickCount() < xLastTimeCheckTime) 
     675          { 
     676            /* overflow of timer, just recover. delay will be wrong. */ 
     677            xLastTimeCheckTime = xTaskGetTickCount(); 
     678            solarState = SOL_NO_INIT; /* restart the measurement cycle (without time check at first) */ 
     679          } 
     680          else 
     681          { 
     682            /* not time to get the time info. do a regular reading cycle without time */ 
     683            solarState = SOL_NO_INIT; /* restart the measurement cycle (without time check at first) */ 
     684          } 
     685        } /* else */ 
    615686 
    616687      }