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) */