- Timestamp:
- 08/14/09 11:24:55 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/freeRTOSexample/Source/EnergyMeters/Meters_ISRs.c
r19 r22 2 2 #include "semphr.h" 3 3 #include "task.h" 4 #include "MetersIncludes.h" 4 5 5 extern basementGasReading;6 6 extern xMetersSemaphore; 7 extern xTickCount; /* millisecond tick counter */ 8 9 void handleGasMeterTick(void); 7 10 8 11 /* The interrupt entry point. */ … … 19 22 if ((IO2_INT_STAT_R & (1 << 10)) != 0) /* P2.10 interrupt triggered */ 20 23 { 21 basementGasReading++;24 handleGasMeterTick(); 22 25 } 23 26 // else if ((IO2_INT_STAT_R & (1 << n)) != 0) /* some other interrupt triggered */ … … 56 59 } 57 60 61 void 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 } 58 68 59 60