Changeset 32 for webserver/example/EnergyMeters/Source
- Timestamp:
- 08/14/09 23:28:59 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c
r30 r32 70 70 * enough on the web page to be read by the server 71 71 */ 72 if ( currentTime > ((unsigned long long)meterItems[METER_INDEX_GAS].timeLastTick + ((unsigned long long)ACCUMULATE_TICK_THRESHOLD_SEC * (unsigned long long)1000)) )72 if ( currentTime > ((unsigned long long)meterItems[METER_INDEX_GAS].timeBeforeLastTick + ((unsigned long long)ACCUMULATE_TICK_THRESHOLD_SEC * (unsigned long long)1000)) ) 73 73 { 74 /* if the last meter tick happened longer than DEBOUNCE_TICK_THRESHOLD_MS ago (i.e. the switch did not just bounce) */ 74 /* if the last meter tick happened longer than DEBOUNCE_TICK_THRESHOLD_MS ago (i.e. the switch did not just bounce), 75 * we create a new data item 76 */ 75 77 meterItems[METER_INDEX_GAS].timeBeforeLastTick = meterItems[METER_INDEX_GAS].timeLastTick; /* when did the tick before the last tick occur? (epoch in milliseconds) */ 76 78 meterItems[METER_INDEX_GAS].timeLastTick = currentTime; /* when did the last tick occur? (epoch in milliseconds) */ … … 81 83 else 82 84 { 83 ; /* nothing to do, curentValue was increased already above */ 85 /* do not create a new data item, but update the current "last" data item */ 86 meterItems[METER_INDEX_GAS].timeLastTick = currentTime; 87 meterItems[METER_INDEX_GAS].valueLastTick = meterItems[METER_INDEX_GAS].currentValue; 84 88 } 85 89 }