Skip to content

Commit 227b36a

Browse files
committed
Updated ESP Insights examples.
1 parent 10f7c9a commit 227b36a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

libraries/Insights/examples/DiagnosticsSmokeTest/DiagnosticsSmokeTest.ino

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void smoke_test()
3636
if (s_reset_count > MAX_CRASHES) {
3737
ESP_DIAG_EVENT(TAG, "[count][%d]", count);
3838
} else {
39-
log_e("[count][%d] [crash_count][%"PRIu32"] [excvaddr][0x0f] Crashing...", count, s_reset_count);
39+
log_e("[count][%d] [crash_count][%" PRIu32 "] [excvaddr][0x0f] Crashing...", count, s_reset_count);
4040
*(int *)0x0F = 0x10;
4141
}
4242
}
@@ -51,7 +51,7 @@ static void smoke_test()
5151
void *p = malloc(size);
5252
if (p) {
5353
memset(p, size, 'A' + (esp_random() % 26));
54-
log_i("Allocated %"PRIu32" bytes", size);
54+
log_i("Allocated %" PRIu32 " bytes", size);
5555
}
5656
s_ptrs[count % MAX_PTRS] = p;
5757
} else {
@@ -70,10 +70,13 @@ void setup()
7070
Serial.begin(115200);
7171
WiFi.mode(WIFI_STA);
7272
WiFi.begin(WIFI_SSID, WIFI_PASSPHRASE);
73-
if(!WiFi.isConnected()) {
74-
delay(2000);
73+
while (WiFi.status() != WL_CONNECTED) {
74+
delay(500);
75+
Serial.print(".");
7576
}
76-
77+
Serial.println("");
78+
Serial.println("WiFi connected");
79+
7780
esp_err_t ret = Insights.init(insights_auth_key, ESP_DIAG_LOG_TYPE_ERROR | ESP_DIAG_LOG_TYPE_WARNING | ESP_DIAG_LOG_TYPE_EVENT);
7881
if(ret != ESP_OK) {
7982
ESP.restart();

libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ void setup()
1212
Serial.begin(115200);
1313
WiFi.mode(WIFI_STA);
1414
WiFi.begin(WIFI_SSID, WIFI_PASSPHRASE);
15-
if(!WiFi.isConnected()) {
16-
delay(2000);
15+
while (WiFi.status() != WL_CONNECTED) {
16+
delay(500);
17+
Serial.print(".");
1718
}
19+
Serial.println("");
20+
Serial.println("WiFi connected");
1821
esp_err_t ret = Insights.init(insights_auth_key, ESP_DIAG_LOG_TYPE_ERROR | ESP_DIAG_LOG_TYPE_WARNING | ESP_DIAG_LOG_TYPE_EVENT);
1922
if(ret != ESP_OK) {
2023
ESP.restart();

0 commit comments

Comments
 (0)