update mode_pop_callback to not loop to 0
This commit is contained in:
		
							parent
							
								
									9739ddcf16
								
							
						
					
					
						commit
						595a13a7c1
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -136,8 +136,14 @@ void fan_pop_callback(void *ptr)
 | 
			
		|||
void mode_pop_callback(void *ptr)
 | 
			
		||||
{
 | 
			
		||||
    uint8_t current_mode = ac_get_mode();
 | 
			
		||||
    uint8_t new_mode = (current_mode + 1) % 3; // Loop back to 0 when reaching 2
 | 
			
		||||
    ac_set_state(new_mode, ac_get_temperature(), ac_get_fan_speed());
 | 
			
		||||
    //uint8_t new_mode = (current_mode + 1) % 3; // Loop back to 1 when reaching 2
 | 
			
		||||
    if(current_mode == 1) {
 | 
			
		||||
        ac_set_state(2, ac_get_temperature(), ac_get_fan_speed());
 | 
			
		||||
    } else if(current_mode == 2) {
 | 
			
		||||
        ac_set_state(1, ac_get_temperature(), ac_get_fan_speed());
 | 
			
		||||
    } 
 | 
			
		||||
    
 | 
			
		||||
    //ac_set_state(new_mode, ac_get_temperature(), ac_get_fan_speed());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ac_toggle_pop_callback(void *ptr)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue