Convert some AVR GPIO operations to macros (#23424)
This commit is contained in:
		
							parent
							
								
									7220715dd1
								
							
						
					
					
						commit
						61c7c1f74c
					
				
					 71 changed files with 877 additions and 840 deletions
				
			
		| 
						 | 
				
			
			@ -100,21 +100,19 @@ bool led_update_user(led_t led_state)
 | 
			
		|||
{
 | 
			
		||||
    if (led_state.caps_lock) {
 | 
			
		||||
        // output high
 | 
			
		||||
        DDRD |= (1<<6);
 | 
			
		||||
        PORTD |= (1<<6);
 | 
			
		||||
        gpio_set_pin_output(D6);
 | 
			
		||||
        gpio_write_pin_high(D6);
 | 
			
		||||
    } else {
 | 
			
		||||
        // Hi-Z
 | 
			
		||||
        DDRD &= ~(1<<6);
 | 
			
		||||
        PORTD &= ~(1<<6);
 | 
			
		||||
        gpio_set_pin_input(D6);
 | 
			
		||||
    }
 | 
			
		||||
    if (led_state.num_lock) {
 | 
			
		||||
        // output low
 | 
			
		||||
        DDRC |= (1<<7);
 | 
			
		||||
        PORTC |= ~(1<<7);
 | 
			
		||||
        gpio_set_pin_output(C7);
 | 
			
		||||
        gpio_write_pin_low(C7);
 | 
			
		||||
    } else {
 | 
			
		||||
        // Hi-Z
 | 
			
		||||
        DDRC &= ~(1<<7);
 | 
			
		||||
        PORTC &= ~(1<<7);
 | 
			
		||||
        gpio_set_pin_input(C7);
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue