mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Feed watchdog when no component loops (#2857)
This commit is contained in:
		
				
					committed by
					
						 Jesse Hills
						Jesse Hills
					
				
			
			
				
	
			
			
			
						parent
						
							7ee4bb621c
						
					
				
				
					commit
					df315a1f51
				
			| @@ -37,6 +37,7 @@ void Application::setup() { | |||||||
|  |  | ||||||
|     component->call(); |     component->call(); | ||||||
|     this->scheduler.process_to_add(); |     this->scheduler.process_to_add(); | ||||||
|  |     this->feed_wdt(); | ||||||
|     if (component->can_proceed()) |     if (component->can_proceed()) | ||||||
|       continue; |       continue; | ||||||
|  |  | ||||||
| @@ -46,14 +47,15 @@ void Application::setup() { | |||||||
|     do { |     do { | ||||||
|       uint32_t new_app_state = STATUS_LED_WARNING; |       uint32_t new_app_state = STATUS_LED_WARNING; | ||||||
|       this->scheduler.call(); |       this->scheduler.call(); | ||||||
|  |       this->feed_wdt(); | ||||||
|       for (uint32_t j = 0; j <= i; j++) { |       for (uint32_t j = 0; j <= i; j++) { | ||||||
|         this->components_[j]->call(); |         this->components_[j]->call(); | ||||||
|         new_app_state |= this->components_[j]->get_component_state(); |         new_app_state |= this->components_[j]->get_component_state(); | ||||||
|         this->app_state_ |= new_app_state; |         this->app_state_ |= new_app_state; | ||||||
|  |         this->feed_wdt(); | ||||||
|       } |       } | ||||||
|       this->app_state_ = new_app_state; |       this->app_state_ = new_app_state; | ||||||
|       yield(); |       yield(); | ||||||
|       this->feed_wdt(); |  | ||||||
|     } while (!component->can_proceed()); |     } while (!component->can_proceed()); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -65,6 +67,7 @@ void Application::loop() { | |||||||
|   uint32_t new_app_state = 0; |   uint32_t new_app_state = 0; | ||||||
|  |  | ||||||
|   this->scheduler.call(); |   this->scheduler.call(); | ||||||
|  |   this->feed_wdt(); | ||||||
|   for (Component *component : this->looping_components_) { |   for (Component *component : this->looping_components_) { | ||||||
|     { |     { | ||||||
|       WarnIfComponentBlockingGuard guard{component}; |       WarnIfComponentBlockingGuard guard{component}; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user