Changeset 22 for webserver/example

Show
Ignore:
Timestamp:
08/14/09 11:24:55 (15 years ago)
Author:
phil
Message:

deleted some test files,
gas meter values (unsigned long long) now updated.
added epoch time handling

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • webserver/example/freeRTOSexample/Demo/ARM7_LPC2368_Rowley/RTOSDemo.hzp

    r19 r22  
    1111      </file> 
    1212      <file Name="portlcd.c" file_name="LCD/portlcd.c"> 
    13         <configuration Name="ARM Flash Debug" build_exclude_from_build="No"/> 
    14       </file> 
    15       <file Name="blocktim.c" file_name="../Common/Minimal/blocktim.c"> 
    16         <configuration Name="ARM Flash Debug" build_exclude_from_build="No"/> 
    17       </file> 
    18       <file Name="integer.c" file_name="../Common/Minimal/integer.c"> 
    19         <configuration Name="ARM Flash Debug" build_exclude_from_build="No"/> 
    20       </file> 
    21       <file Name="BlockQ.c" file_name="../Common/Minimal/BlockQ.c"> 
    2213        <configuration Name="ARM Flash Debug" build_exclude_from_build="No"/> 
    2314      </file> 
     
    3627        <configuration Name="ARM Flash Debug" build_exclude_from_build="No"/> 
    3728        <configuration Name="Common" asm_additional_options=""/> 
    38       </file> 
    39       <file Name="death.c" file_name="../Common/Minimal/death.c"/> 
    40       <file Name="PollQ.c" file_name="../Common/Minimal/PollQ.c"/> 
    41       <file Name="semtest.c" file_name="../Common/Minimal/semtest.c"> 
    42         <configuration Name="Common" c_enforce_ansi_checking="No"/> 
    4329      </file> 
    4430    </folder> 
     
    10591      <file file_name="../../Source/EnergyMeters/Meters_ISRs.c"/> 
    10692      <file file_name="../../Source/EnergyMeters/Meters.c"/> 
     93      <file file_name="../../Source/EnergyMeters/MetersIncludes.h"/> 
     94      <file file_name="../../Source/EnergyMeters/timeConversion.c"/> 
    10795    </folder> 
    10896  </project> 
  • webserver/example/freeRTOSexample/Demo/ARM7_LPC2368_Rowley/RTOSDemo.hzs

    r19 r22  
    4545 </Watch1> 
    4646 <Watch2> 
    47   <Watches active="0" update="Never" > 
    48    <Watchpoint linenumber="57" radix="10" name="s" expression="s" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    49    <Watchpoint linenumber="55" radix="10" name="h" expression="h" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    50    <Watchpoint linenumber="56" radix="10" name="m" expression="m" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    51   </Watches> 
     47  <Watches active="0" update="Never" /> 
    5248 </Watch2> 
    5349 <Watch3> 
    54   <Watches active="1" update="Never" /> 
     50  <Watches active="1" update="Never" > 
     51   <Watchpoint evalMode="2" linenumber="0" numelements="10" evalType="0" radix="-1" name="meterItems" expression="meterItems" filename="" /> 
     52  </Watches> 
    5553 </Watch3> 
    5654 <Watch4> 
    5755  <Watches active="0" update="Never" > 
    58    <Watchpoint linenumber="54" radix="10" name="s" expression="s" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    59    <Watchpoint linenumber="139" radix="16" name="partstNUM_LEDS" expression="partstNUM_LEDS" filename="c:/dokumente und einstellungen/birdy/desktop/freertos/demo/arm7_lpc2368_rowley/partest/partest.c" /> 
    60    <Watchpoint linenumber="53" radix="16" name="xLastMeterTaskRunTime" expression="xLastMeterTaskRunTime" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    61    <Watchpoint linenumber="131" radix="-1" name="xFlashRate" expression="xFlashRate" filename="c:/dokumente und einstellungen/birdy/desktop/freertos/demo/common/minimal/flash.c" /> 
    62    <Watchpoint linenumber="54" radix="10" name="h" expression="h" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    63    <Watchpoint linenumber="54" radix="10" name="s" expression="s" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    64    <Watchpoint linenumber="53" radix="16" name="xLastMeterTaskRunTime" expression="xLastMeterTaskRunTime" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    65    <Watchpoint linenumber="42" radix="16" name="EXTINT" expression="EXTINT" filename="d:/freertosexample/source/energymeters/meters_isrs.c" /> 
    66    <Watchpoint linenumber="55" radix="10" name="m" expression="m" filename="d:/freertosexample/source/energymeters/meters.c" /> 
    67    <Watchpoint linenumber="131" radix="-1" name="xLastFlashTime" expression="xLastFlashTime" filename="c:/dokumente und einstellungen/birdy/desktop/freertos/demo/common/minimal/flash.c" /> 
    68    <Watchpoint linenumber="139" radix="-1" name="uxLED" expression="uxLED" filename="c:/dokumente und einstellungen/birdy/desktop/freertos/demo/arm7_lpc2368_rowley/partest/partest.c" /> 
    69    <Watchpoint linenumber="0" radix="-1" name="xStart" expression="xStart" filename="" /> 
    70    <Watchpoint linenumber="125" radix="-1" name="led_1_state" expression="led_1_state" filename="c:/dokumente und einstellungen/birdy/desktop/freertos/demo/arm7_lpc2368_rowley/partest/partest.c" /> 
    71    <Watchpoint linenumber="37" radix="10" name="xLastMeterTaskRunTime" expression="xLastMeterTaskRunTime" filename="d:/freertosexample/source/energymeters/meters.c" /> 
     56   <Watchpoint evalMode="2" linenumber="66" numelements="10" evalType="0" radix="-1" name="meterItems" expression="meterItems" filename="d:/freertosexample/source/energymeters/meters_isrs.c" /> 
    7257  </Watches> 
    7358 </Watch4> 
    7459 <Files> 
    75   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freertosexample\source\tasks.c" y="1327" path="D:\freertosexample\source\tasks.c" left="0" selected="0" name="unnamed" top="1316" /> 
    76   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\EnergyMeters\Meters.c" y="25" path="D:\freeRTOSexample\Source\EnergyMeters\Meters.c" left="0" selected="0" name="unnamed" top="21" /> 
    77   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\EnergyMeters\Meters_ISRs.c" y="18" path="D:\freeRTOSexample\Source\EnergyMeters\Meters_ISRs.c" left="0" selected="0" name="unnamed" top="0" /> 
    78   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Demo\Common\Minimal\flash.c" y="132" path="D:\freeRTOSexample\Demo\Common\Minimal\flash.c" left="0" selected="0" name="unnamed" top="120" /> 
    79   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\webserver\emac.c" y="25" path="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\webserver\emac.c" left="0" selected="0" name="unnamed" top="14" /> 
    80   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\webserver\uIP_Task.c" y="227" path="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\webserver\uIP_Task.c" left="0" selected="0" name="unnamed" top="210" /> 
    81   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freertosexample\demo\arm7_lpc2368_rowley\webserver\EMAC_ISR.c" y="23" path="D:\freertosexample\demo\arm7_lpc2368_rowley\webserver\EMAC_ISR.c" left="0" selected="0" name="unnamed" top="15" /> 
    82   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\main.c" y="121" path="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\main.c" left="0" selected="0" name="unnamed" top="108" /> 
    83   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Demo\Common\Minimal\semtest.c" y="215" path="D:\freeRTOSexample\Demo\Common\Minimal\semtest.c" left="0" selected="0" name="unnamed" top="203" /> 
    84   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\queue.c" y="467" path="D:\freeRTOSexample\Source\queue.c" left="0" selected="0" name="unnamed" top="454" /> 
    85   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\include\targets\LPC23xx.h" y="771" path="D:\freeRTOSexample\Source\include\targets\LPC23xx.h" left="0" selected="0" name="unnamed" top="756" /> 
    86   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\portable\GCC\ARM7_LPC23xx\portISR.c" y="82" path="D:\freeRTOSexample\Source\portable\GCC\ARM7_LPC23xx\portISR.c" left="0" selected="0" name="unnamed" top="69" /> 
    87   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="2" debugPath="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" y="219" path="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" left="0" selected="1" name="unnamed" top="207" /> 
    88   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\birdy\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" y="18" path="C:\Dokumente und Einstellungen\birdy\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" left="0" selected="0" name="unnamed" top="6" /> 
     60  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\include\FreeRTOS.h" y="0" path="D:\freeRTOSexample\Source\include\FreeRTOS.h" left="0" selected="0" name="unnamed" top="0" /> 
     61  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\tasks.c" y="1897" path="D:\freeRTOSexample\Source\tasks.c" left="0" selected="1" name="unnamed" top="1885" /> 
     62  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="63" debugPath="D:\freeRTOSexample\Source\EnergyMeters\Meters_ISRs.c" y="65" path="D:\freeRTOSexample\Source\EnergyMeters\Meters_ISRs.c" left="0" selected="0" name="unnamed" top="47" /> 
     63  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\main.c" y="113" path="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\main.c" left="0" selected="0" name="unnamed" top="149" /> 
     64  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\list.c" y="0" path="D:\freeRTOSexample\Source\list.c" left="0" selected="0" name="unnamed" top="0" /> 
     65  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\ParTest\ParTest.c" y="0" path="D:\freeRTOSexample\Demo\ARM7_LPC2368_Rowley\ParTest\ParTest.c" left="0" selected="0" name="unnamed" top="0" /> 
     66  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freertosexample\source\energymeters\MetersIncludes.h" y="2" path="D:\freertosexample\source\energymeters\MetersIncludes.h" left="0" selected="0" name="unnamed" top="0" /> 
     67  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="45" debugPath="D:\freeRTOSexample\Source\EnergyMeters\Meters.c" y="120" path="D:\freeRTOSexample\Source\EnergyMeters\Meters.c" left="0" selected="0" name="unnamed" top="107" /> 
     68  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="17" debugPath="D:\freeRTOSexample\Source\EnergyMeters\timeConversion.c" y="49" path="D:\freeRTOSexample\Source\EnergyMeters\timeConversion.c" left="0" selected="0" name="unnamed" top="66" /> 
     69  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="D:\freeRTOSexample\Source\portable\GCC\ARM7_LPC23xx\portISR.c" y="142" path="D:\freeRTOSexample\Source\portable\GCC\ARM7_LPC23xx\portISR.c" left="0" selected="0" name="unnamed" top="127" /> 
     70  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\birdy\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" y="276" path="C:\Dokumente und Einstellungen\birdy\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" /> 
    8971 </Files> 
    90  <ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="Macraigor Wiggler (20 Pin)" debugSearchFileMap="" fileDialogInitialDirectory="D:\freeRTOSexample\Source\EnergyMeters" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388479" debugSearchPath="" buildConfiguration="ARM Flash Release" /> 
     72 <ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="Macraigor Wiggler (20 Pin)" debugSearchFileMap="" fileDialogInitialDirectory="D:\freeRTOSexample\Source\EnergyMeters" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388479" debugSearchPath="" buildConfiguration="ARM Flash Debug" /> 
    9173</session> 
  • webserver/example/freeRTOSexample/Demo/ARM7_LPC2368_Rowley/main.c

    r19 r22  
    5656 
    5757/* Demo app includes. */ 
    58 #include "BlockQ.h" 
    59 #include "death.h" 
    60 #include "integer.h" 
    61 #include "blocktim.h" 
     58 
    6259#include "portlcd.h" 
    6360#include "flash.h" 
    64 #include "partest.h" 
    65 #include "semtest.h" 
    66 #include "PollQ.h" 
     61 
    6762 
    6863/* Demo application definitions. */ 
     
    7469#define mainQUEUE_POLL_PRIORITY                         ( tskIDLE_PRIORITY + 2 ) 
    7570#define mainCHECK_TASK_PRIORITY                         ( tskIDLE_PRIORITY + 3 ) 
    76 #define mainSEM_TEST_PRIORITY                           ( tskIDLE_PRIORITY + 1 ) 
    77 #define mainBLOCK_Q_PRIORITY                            ( tskIDLE_PRIORITY + 2 ) 
    7871#define mainFLASH_PRIORITY                  ( tskIDLE_PRIORITY + 2 ) 
    79 #define mainCREATOR_TASK_PRIORITY           ( tskIDLE_PRIORITY + 3 ) 
    80 #define mainINTEGER_TASK_PRIORITY           ( tskIDLE_PRIORITY ) 
     72 
    8173 
    8274 
     
    134126 
    135127//  vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); 
    136   vStartMetersTask( mainBLOCK_Q_PRIORITY ); 
     128  vStartMetersTask( mainFLASH_PRIORITY ); 
    137129        /* Start the standard demo tasks. */ 
    138130//  vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); 
     
    181173                /* Has an error been found in any task? */ 
    182174 
    183         if( xAreBlockingQueuesStillRunning() != pdTRUE ) 
    184                 { 
    185                         xErrorOccurred = pdTRUE; 
    186                 } 
    187  
    188                 if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) 
    189                 { 
    190                         xErrorOccurred = pdTRUE; 
    191                 } 
    192  
    193         if( xAreSemaphoreTasksStillRunning() != pdTRUE ) 
    194         { 
    195             xErrorOccurred = pdTRUE; 
    196         } 
    197  
    198         if( xArePollingQueuesStillRunning() != pdTRUE ) 
    199         { 
    200             xErrorOccurred = pdTRUE; 
    201         } 
    202  
    203         if( xIsCreateTaskStillRunning() != pdTRUE ) 
    204         { 
    205             xErrorOccurred = pdTRUE; 
    206         } 
    207  
    208         if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) 
    209         { 
    210             xErrorOccurred = pdTRUE; 
    211         } 
     175 
    212176 
    213177        LCD_cls(); 
  • webserver/example/freeRTOSexample/Source/EnergyMeters/Meters.c

    r19 r22  
    44#include "task.h" 
    55 
    6 #define metersSTACK_SIZE                configMINIMAL_STACK_SIZE 
     6#define metersSTACK_SIZE                configMINIMAL_STACK_SIZE+200 
    77/* masks for RTC */ 
    88#define MASKSEC 0x3F                                                                            // Second 00..59   00000000:00000000:00xxxxxx 
     
    1010#define MASKHR  0x1F0000                                                                        // Hour 00..23     000xxxxx:00000000:00000000 
    1111 
     12#include "MetersIncludes.h" 
     13 
     14extern xTickCount; /* tick counter (milliseconds) */ 
    1215 
    1316portBASE_TYPE Init_P2_0(void); 
     
    2124 
    2225portTickType xLastMeterTaskRunTime; /* keeps the last time the meter calculation ran */ 
    23 portTickType xMeterIdleRate = 1000; /* the rate (in ticks = ms) at which the calculation runs when no pulses triggered a calculation */ 
    2426 
    2527 
     
    3537         
    3638  Init_P2_0(); /* init GPIO for meters */ 
    37   xLastMeterTaskRunTime = xTaskGetTickCount(); /* init last run time */ 
    38  
    3939 
    4040  for( ;; ) 
     
    7373{ 
    7474 
     75  initMeterItems(); 
    7576  /* Spawn the task. */ 
    7677  xTaskCreate( vMeters_Task, ( signed portCHAR * ) "Meters", metersSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL ); 
     
    106107 
    107108} 
     109 
     110void initMeterItems(void) 
     111{ 
     112  int i; 
     113  for (i = 0; i < NUMBER_OF_METERS; i++) 
     114  { 
     115    meterItems[i].meterEnabled = 0; // disable all meters 
     116  } 
     117 
     118  // Init Gas meter 
     119  meterItems[METER_INDEX_GAS].meterEnabled = 1;  /* 0: item not used, 1: meter enabled */ 
     120  meterItems[METER_INDEX_GAS].timeLastTick = getEpochTimeWithMs(); /* when did the last tick occur? epoch (seconds) */ 
     121  meterItems[METER_INDEX_GAS].timeBeforeLastTick = getEpochTimeWithMs(); /* when did the tick before last tick occur? epoch (seconds) */ 
     122  meterItems[METER_INDEX_GAS].valueLastTick = 0;   /* what value did we have at the last tick? */ 
     123  meterItems[METER_INDEX_GAS].valueBeforeLastTick = 1;   /* what value did we have at the tick before the last tick? */ 
     124 
     125} 
  • webserver/example/freeRTOSexample/Source/EnergyMeters/Meters_ISRs.c

    r19 r22  
    22#include "semphr.h" 
    33#include "task.h" 
     4#include "MetersIncludes.h" 
    45 
    5 extern basementGasReading; 
    66extern xMetersSemaphore; 
     7extern xTickCount; /* millisecond tick counter */ 
     8 
     9void handleGasMeterTick(void); 
    710 
    811/* The interrupt entry point. */ 
     
    1922  if ((IO2_INT_STAT_R & (1 << 10)) != 0) /* P2.10 interrupt triggered */ 
    2023  { 
    21     basementGasReading++
     24    handleGasMeterTick()
    2225  } 
    2326 // else if ((IO2_INT_STAT_R & (1 << n)) != 0) /* some other interrupt triggered */ 
     
    5659} 
    5760 
     61void handleGasMeterTick(void) 
     62{ 
     63  meterItems[METER_INDEX_GAS].timeBeforeLastTick = meterItems[METER_INDEX_GAS].timeLastTick;     /* when did the tick before the last tick occur? */ 
     64  meterItems[METER_INDEX_GAS].timeLastTick = getEpochTimeWithMs(); /* when did the last tick occur? epoch (seconds) */ 
     65  meterItems[METER_INDEX_GAS].valueLastTick = 0;   /* what value did we have at the last tick? */ 
     66  meterItems[METER_INDEX_GAS].valueBeforeLastTick = 1;   /* what value did we have at the tick before the last tick? */ 
     67} 
    5868 
    59  
    60