[Core] Optimisation - Add RGB LED colour set check in drivers (#21134)
This commit is contained in:
		
							parent
							
								
									9a6056d09c
								
							
						
					
					
						commit
						d1d0925cf9
					
				
					 12 changed files with 41 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -72,6 +72,9 @@ void IS31FL3218_init(void) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void IS31FL3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
 | 
			
		||||
    if (g_pwm_buffer[index * 3 + 0] == red && g_pwm_buffer[index * 3 + 1] == green && g_pwm_buffer[index * 3 + 2] == blue) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    g_pwm_buffer[index * 3 + 0]  = red;
 | 
			
		||||
    g_pwm_buffer[index * 3 + 1]  = green;
 | 
			
		||||
    g_pwm_buffer[index * 3 + 2]  = blue;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue