- Timestamp:
- 02/14/10 16:25:17 (15 years ago)
- Files:
-
- webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c (modified) (1 diff)
- webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c (modified) (1 diff)
- webserver/example/EnergyMeters/Source/EnergyMeters/MetersIncludes.h (modified) (1 diff)
- webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c
r49 r50 297 297 meterItems[METER_INDEX_EL2].valueBeforeLastTick 298 298 ); 299 300 301 strcat( uip_appdata, cCountBuf ); 302 303 304 299 strcat( uip_appdata, cCountBuf ); 300 301 302 sprintf( cCountBuf, "AU1meter %u %u %u %u %u %u %u %u\r\n", 303 meterItems[METER_INDEX_AU1].meterEnabled, 304 (portLONG)(meterItems[METER_INDEX_AU1].timeLastTick >> 32), 305 (portLONG)(meterItems[METER_INDEX_AU1].timeLastTick & 0xffffffff), 306 (portLONG)(meterItems[METER_INDEX_AU1].timeBeforeLastTick >> 32), 307 (portLONG)(meterItems[METER_INDEX_AU1].timeBeforeLastTick & 0xffffffff), 308 meterItems[METER_INDEX_AU1].valueLastTick, 309 meterItems[METER_INDEX_AU1].currentValue, 310 meterItems[METER_INDEX_AU1].valueBeforeLastTick 311 ); 312 strcat( uip_appdata, cCountBuf ); 313 314 sprintf( cCountBuf, "AU2meter %u %u %u %u %u %u %u %u\r\n", 315 meterItems[METER_INDEX_AU2].meterEnabled, 316 (portLONG)(meterItems[METER_INDEX_AU2].timeLastTick >> 32), 317 (portLONG)(meterItems[METER_INDEX_AU2].timeLastTick & 0xffffffff), 318 (portLONG)(meterItems[METER_INDEX_AU2].timeBeforeLastTick >> 32), 319 (portLONG)(meterItems[METER_INDEX_AU2].timeBeforeLastTick & 0xffffffff), 320 meterItems[METER_INDEX_AU2].valueLastTick, 321 meterItems[METER_INDEX_AU2].currentValue, 322 meterItems[METER_INDEX_AU2].valueBeforeLastTick 323 ); 324 strcat( uip_appdata, cCountBuf ); 305 325 306 326 //strcat( ( char * ) uip_appdata, ( char * ) "1234test" ); webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c
r47 r50 171 171 172 172 173 // Init Auxiliary meter 1 174 meterItems[METER_INDEX_AU1].meterEnabled = 1; /* 0: item not used, 1: meter enabled */ 175 meterItems[METER_INDEX_AU1].timeLastTick = getEpochTimeWithMs(); /* when did the last tick occur? epoch (seconds) */ 176 meterItems[METER_INDEX_AU1].timeBeforeLastTick = getEpochTimeWithMs(); /* when did the tick before last tick occur? epoch (seconds) */ 177 meterItems[METER_INDEX_AU1].valueLastTick = 1; /* what value did we have at the last tick? */ 178 meterItems[METER_INDEX_AU1].currentValue = 1; /* same: start value of the meter */ 179 meterItems[METER_INDEX_AU1].valueBeforeLastTick = 0; /* what value did we have at the tick before the last tick? */ 180 181 // Init Auxiliary meter 2 182 meterItems[METER_INDEX_AU2].meterEnabled = 1; /* 0: item not used, 1: meter enabled */ 183 meterItems[METER_INDEX_AU2].timeLastTick = getEpochTimeWithMs(); /* when did the last tick occur? epoch (seconds) */ 184 meterItems[METER_INDEX_AU2].timeBeforeLastTick = getEpochTimeWithMs(); /* when did the tick before last tick occur? epoch (seconds) */ 185 meterItems[METER_INDEX_AU2].valueLastTick = 1; /* what value did we have at the last tick? */ 186 meterItems[METER_INDEX_AU2].currentValue = 1; /* same: start value of the meter */ 187 meterItems[METER_INDEX_AU2].valueBeforeLastTick = 0; /* what value did we have at the tick before the last tick? */ 188 189 173 190 174 191 } webserver/example/EnergyMeters/Source/EnergyMeters/MetersIncludes.h
r47 r50 3 3 unsigned long long getEpochTimeWithMs(void); 4 4 5 #define NUMBER_OF_METERS 5/* the number of meters we use */5 #define NUMBER_OF_METERS 6 /* the number of meters we use */ 6 6 7 #define METER_INDEX_TST 0 /* index of the button example meter data */8 #define METER_INDEX_GAS 1 /* index of the gas meter data */9 #define METER_INDEX_EL1 2 /* index of the Electricity 1 meter data */10 #define METER_INDEX_EL2 3 /* index of the Electricity 2 meter data */11 12 7 #define METER_INDEX_TST 0 /* index of the button example meter data */ 8 #define METER_INDEX_GAS 1 /* index of the gas meter data */ 9 #define METER_INDEX_EL1 2 /* index of the Electricity 1 meter data */ 10 #define METER_INDEX_EL2 3 /* index of the Electricity 2 meter data */ 11 #define METER_INDEX_AU1 4 /* index of Auxiliary input 1 */ 12 #define METER_INDEX_AU2 5 /* index of Auxiliary input 1 */ 13 13 14 14 webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c
r47 r50 53 53 else if ((IO2_INT_STAT_R & (1 << 3)) != 0) /* P0.3 interrupt triggered - connector J4, Pin 3*/ 54 54 { 55 handleMeterTick( 3);55 handleMeterTick(METER_INDEX_AU1); 56 56 IO2_INT_CLR |= (1<<3); 57 57 } 58 58 else if ((IO2_INT_STAT_R & (1 << 4)) != 0) /* P0.4 interrupt triggered - connector J4, Pin 4*/ 59 59 { 60 handleMeterTick( 4);60 handleMeterTick(METER_INDEX_AU2); 61 61 IO2_INT_CLR |= (1<<4); 62 62 } 63 63 64 64 /* Clear the interrupt. */ 65 IO2_INT_CLR |= (1<<10);66 65 VICVectAddr = 0; 67 66