Show
Ignore:
Timestamp:
02/07/10 11:36:21 (15 years ago)
Author:
phil
Message:

have now got METER_INDEX_BUTTON and METER_INDEX_GAS with display on page

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c

    r45 r46  
    138138  } 
    139139 
     140  // Init Example Button meter 
     141  meterItems[METER_INDEX_BUTTON].meterEnabled = 1;  /* 0: item not used, 1: meter enabled */ 
     142  meterItems[METER_INDEX_BUTTON].timeLastTick = getEpochTimeWithMs(); /* when did the last tick occur? epoch (seconds) */ 
     143  meterItems[METER_INDEX_BUTTON].timeBeforeLastTick = getEpochTimeWithMs(); /* when did the tick before last tick occur? epoch (seconds) */ 
     144  meterItems[METER_INDEX_BUTTON].valueLastTick = 1;   /* what value did we have at the last tick? */ 
     145  meterItems[METER_INDEX_BUTTON].currentValue = 1; /* same: start value of the meter */ 
     146  meterItems[METER_INDEX_BUTTON].valueBeforeLastTick = 0;   /* what value did we have at the tick before the last tick? */ 
     147 
    140148  // Init Gas meter 
    141149  meterItems[METER_INDEX_GAS].meterEnabled = 1;  /* 0: item not used, 1: meter enabled */ 
  • webserver/example/EnergyMeters/Source/EnergyMeters/MetersIncludes.h

    r45 r46  
    33unsigned long long getEpochTimeWithMs(void); 
    44 
    5 #define NUMBER_OF_METERS 11 /* the number of meters we use */ 
     5#define NUMBER_OF_METERS 5 /* the number of meters we use */ 
    66 
    7 #define METER_INDEX_GAS 10 /* index of the gas meter data */ 
     7#define METER_INDEX_BUTTON 0 /* index of the button example meter data */ 
     8 
     9#define METER_INDEX_GAS 1 /* index of the gas meter data */ 
    810 
    911#define DEBOUNCE_TICK_THRESHOLD_MS 50 /* when two ticks are less than this time period apart, the second tick is ignored (debouncing) */ 
  • webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c

    r45 r46  
    3333  if ((IO2_INT_STAT_R & (1 << 10)) != 0) /* P2.10 interrupt triggered - SPI Load Switch */ 
    3434  { 
    35     handleMeterTick(10); 
     35    handleMeterTick(METER_INDEX_BUTTON); 
    3636    IO2_INT_CLR |= (1<<10); 
    3737  } 
    3838  else if ((IO2_INT_STAT_R & (1 << 0)) != 0) /* P0.0 interrupt triggered - connector J4, Pin 0*/ 
    3939  { 
    40     handleMeterTick(0); 
     40    handleMeterTick(METER_INDEX_GAS); 
    4141    IO2_INT_CLR |= (1<<0); 
    4242  }