 
 #ifdef ARDUINO_ARCH_AVR
     f_wdt = 0;
-    enter_sleep();
+#endif
+  }
+
+#ifdef ARDUINO_ARCH_AVR
+  enter_sleep();
 #endif
 
 #ifdef USE_ESP
 #ifdef USING_WIRELESS
-    delay(100);
+  delay(100);
 #else
-
-
-    Serial.println("going to sleep");
-    ESP.deepSleep(SLEEP_SECONDS * 1000000);
-    delay(100); // sometimes a few more instructions happen
-    // making the non dead code not quite dead
+  Serial.println("going to esp deep sleep");
+  ESP.deepSleep(SLEEP_SECONDS * 1000000);
+  delay(100); // sometimes a few more instructions happen
+  // making the non dead code not quite dead
 #endif // USING_WIRELESS
 #endif // USE_ESP
-   }
-}
+}


////////////////////////////////////////////////////


// doing this so can easily
// add ESP32 etc in one place

  sleep_enable();

  /* Now enter sleep mode. */
  Serial.println("going to deep sleep");
  delay(100); // let serial write
  sleep_mode();

