    return result;
 }
 
+//
+void doreset(void)
+{
+//
+   for (int i = 0; i < pinc; i++)
+      {
+   //
+       EEPROM.write(eeprom[i], 0);
+       pineepromstate[i] = 0;
+       }
+}
+
 // the loop routine runs over and over again forever:
 void loop() 
 {

         if (cmd & TSTMODE)
            {
         //
            cmd |= GETSTAT;
            tstbgn = millis();
            iststmode = true;
            }

const int GETSTAT = 64;

const unsigned long MAX_UNSIGNED_LONG = 4294967295;
const unsigned long TSTLEN = 300000; //5 min
unsigned long tstbgn = 0;
boolean iststmode = false;

