             maxm2.write(0);
             maxm2.stop();
 
-#ifdef DEBUG_FLASH
-            doFlash(led1, 2);
-#endif
+            doFlash(ledPort, led1, 2);
             break;
 
         // Check if within operational time

DeviceI2C maxm1 (MaxMbus, maxm1Dev);
DeviceI2C maxm2 (MaxMbus, maxm2Dev);

#ifdef DEBUG_FLASH
// LEDs are on ports 3 and 4
// LED1 flashes once for the MAXM1 task, twice for the MAXM2 task
Port led1 (3);
// LED2 flashes once per 10 seconds in a minute (1..6)
Port led2 (4);

byte led1_on = 0;
byte led2_on = 0; 
#endif

int is_operational = 0;


            Serial.flush();
#endif
            if (is_operational == 1) {
                doFlash(ledPort, led1, 1);
#ifdef DEBUG_TRACE
                Serial.println("MAXM1");
                Serial.flush();
