Index: /webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c =================================================================== --- /webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c (revision 42) +++ /webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c (revision 45) @@ -40,5 +40,5 @@ vSemaphoreCreateBinary( xMetersSemaphore ); - //Init_P2_0(); /* init GPIO for meters */ + Init_P2_0(); /* init GPIO for meters */ // TODO: put this in again, right now it interferes with Solar UART3! Index: /webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c =================================================================== --- /webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c (revision 43) +++ /webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c (revision 45) @@ -96,4 +96,9 @@ unsigned long long currentTime = getEpochTimeWithMs(); /* current epoch time with ms in ms */ + if (portNum >= NUMBER_OF_METERS) /* allowed index: 0 to (NUMBER_OF_METERS-1) */ + { + return; /* invalid value */ + } + globalValue++; // LCD_cls(); Index: /webserver/example/EnergyMeters/Source/EnergyMeters/MetersIncludes.h =================================================================== --- /webserver/example/EnergyMeters/Source/EnergyMeters/MetersIncludes.h (revision 30) +++ /webserver/example/EnergyMeters/Source/EnergyMeters/MetersIncludes.h (revision 45) @@ -3,7 +3,7 @@ unsigned long long getEpochTimeWithMs(void); -#define NUMBER_OF_METERS 10 /* the number of meters we use */ +#define NUMBER_OF_METERS 11 /* the number of meters we use */ -#define METER_INDEX_GAS 0 /* index of the gas meter data */ +#define METER_INDEX_GAS 10 /* index of the gas meter data */ #define DEBOUNCE_TICK_THRESHOLD_MS 50 /* when two ticks are less than this time period apart, the second tick is ignored (debouncing) */ Index: /webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c =================================================================== --- /webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c (revision 44) +++ /webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/webserver/httpd-cgi.c (revision 45) @@ -239,8 +239,10 @@ //strcat( ( char * ) uip_appdata, ( char * ) "\r\n" ); - sprintf( cCountBuf, "
GASmeter %d %d %d %d %d %d\r\n",
+ sprintf( cCountBuf, "
GASmeter %d %d %d %d %d %d %d %d\r\n",
meterItems[METER_INDEX_GAS].meterEnabled,
- meterItems[METER_INDEX_GAS].timeLastTick,
- meterItems[METER_INDEX_GAS].timeBeforeLastTick,
+ (portLONG)(meterItems[METER_INDEX_GAS].timeLastTick << 32),
+ (portLONG)(meterItems[METER_INDEX_GAS].timeLastTick & 0xffffffff),
+ (portLONG)(meterItems[METER_INDEX_GAS].timeBeforeLastTick << 32),
+ (portLONG)(meterItems[METER_INDEX_GAS].timeBeforeLastTick & 0xffffffff),
meterItems[METER_INDEX_GAS].valueLastTick,
meterItems[METER_INDEX_GAS].currentValue,
Index: /webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/main.c
===================================================================
--- /webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/main.c (revision 37)
+++ /webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/main.c (revision 45)
@@ -128,5 +128,5 @@
// vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
-//* vStartMetersTask( mainFLASH_PRIORITY );
+ vStartMetersTask( mainFLASH_PRIORITY );
vStartSolarTask( mainFLASH_PRIORITY );
Index: /webserver/example/EnergyMeters/EnergyMeters/Common/Minimal/flash.c
===================================================================
--- /webserver/example/EnergyMeters/EnergyMeters/Common/Minimal/flash.c (revision 42)
+++ /webserver/example/EnergyMeters/EnergyMeters/Common/Minimal/flash.c (revision 45)
@@ -148,7 +148,15 @@
for(;;)
{
+
+
+
/* Delay for half the flash period then turn the LED on. */
vTaskDelayUntil( &xLastFlashTime, xFlashRate );
vParTestToggleLED( uxLED );
+
+
+#if 0
+
+// TODO: LCD not fully included in this config ... this would crash!
LCD_cls();
@@ -161,5 +169,5 @@
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );
-
+#endif
/* Delay for half the flash period then turn the LED off. */