add delay
This commit is contained in:
		
							parent
							
								
									60a5dd7415
								
							
						
					
					
						commit
						3240f2311f
					
				| @ -5,6 +5,7 @@ | |||||||
| #include "esp_log.h" | #include "esp_log.h" | ||||||
| #include "esp_wifi.h" | #include "esp_wifi.h" | ||||||
| #include "esp_event.h" | #include "esp_event.h" | ||||||
|  | #include "esp_task_wdt.h" | ||||||
| 
 | 
 | ||||||
| #include "../lib/cli/CLI/CLI.h" | #include "../lib/cli/CLI/CLI.h" | ||||||
| #include "../lib/cli/CMDList/CMDList.h" | #include "../lib/cli/CMDList/CMDList.h" | ||||||
| @ -127,6 +128,14 @@ void wifiInit() | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void app_main() { | void app_main() { | ||||||
|  | 	// disable watchdog
 | ||||||
|  | 	ESP_ERROR_CHECK(esp_task_wdt_deinit()); | ||||||
|  | 
 | ||||||
|  | 	// wait so I have time to open the serial monitor
 | ||||||
|  | 	for (unsigned long i=0; i < 100000; i++){ | ||||||
|  | 		printf("."); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	/* Initialize NVS — it is used to store PHY calibration data */ | 	/* Initialize NVS — it is used to store PHY calibration data */ | ||||||
| 	esp_err_t ret = nvs_flash_init(); | 	esp_err_t ret = nvs_flash_init(); | ||||||
| 	if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { | 	if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { | ||||||
| @ -137,6 +146,8 @@ void app_main() { | |||||||
| 
 | 
 | ||||||
| 	printChipInfo(); | 	printChipInfo(); | ||||||
| 
 | 
 | ||||||
|  | 	wifiInit(); | ||||||
|  | 
 | ||||||
| 	/* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum
 | 	/* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum
 | ||||||
| 	* number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ | 	* number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ | ||||||
| 	EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, | 	EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, | ||||||
| @ -155,10 +166,9 @@ void app_main() { | |||||||
| 		ESP_LOGE(TAG, "UNEXPECTED EVENT"); | 		ESP_LOGE(TAG, "UNEXPECTED EVENT"); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	while(true) | 	// while(true)
 | ||||||
| 	{ | 	{ | ||||||
| 		ESP_LOGI(TAG, ":3"); | 		ESP_LOGI(TAG, ":3"); | ||||||
| 		 |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// running = true;
 | 	// running = true;
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user