     tft.invertDisplay( true );
     while ( !WiFi.smartConfigDone() )
     {
-      delay(500);
+      vTaskDelay( 500 / portTICK_PERIOD_MS );
       Serial.print(".");
     }
     Serial.println("");

  {
    Serial.print( "." );
    tft.print( "." );
    delay( 500 );
  }
  tft.println();
  Serial.println();

    Serial.println( WiFi.status() );
    tft.println( WiFi.status() );
    // restart the AP to try again
    vTaskDelay( 500 / portTICK_PERIOD_MS );
    ESP.restart();
  }
}
