File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
libraries/ESP32/examples/Time/SimpleTime Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,6 @@ void setup() {
3333 // First step is to configure WiFi STA and connect in order to get the current time and date.
3434 Serial.printf (" Connecting to %s " , ssid);
3535 WiFi.begin (ssid, password);
36- while (WiFi.status () != WL_CONNECTED) {
37- delay (500 );
38- Serial.print (" ." );
39- }
40- Serial.println (" CONNECTED" );
41-
42- // set notification call-back function
43- sntp_set_time_sync_notification_cb (timeavailable);
4436
4537 /* *
4638 * NTP server address could be acquired via DHCP,
@@ -52,6 +44,15 @@ void setup() {
5244 */
5345 esp_sntp_servermode_dhcp (1 ); // (optional)
5446
47+ while (WiFi.status () != WL_CONNECTED) {
48+ delay (500 );
49+ Serial.print (" ." );
50+ }
51+ Serial.println (" CONNECTED" );
52+
53+ // set notification call-back function
54+ sntp_set_time_sync_notification_cb (timeavailable);
55+
5556 /* *
5657 * This will set configured ntp servers and constant TimeZone/daylightOffset
5758 * should be OK if your time zone does not need to adjust daylightOffset twice a year,
You can’t perform that action at this time.
0 commit comments