Update GPIO API usage in keyboard code (#23361)
This commit is contained in:
		
							parent
							
								
									5426a7a129
								
							
						
					
					
						commit
						d09a06a1b3
					
				
					 390 changed files with 3912 additions and 3913 deletions
				
			
		| 
						 | 
				
			
			@ -23,22 +23,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		|||
// runs once when the firmware starts up
 | 
			
		||||
void matrix_init_kb(void) {
 | 
			
		||||
    // Set the LEDs pins
 | 
			
		||||
    setPinOutput(D5); // Layer 1 Status LED
 | 
			
		||||
    gpio_set_pin_output(D5); // Layer 1 Status LED
 | 
			
		||||
 | 
			
		||||
    matrix_init_user();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Set LED based on layer
 | 
			
		||||
__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
 | 
			
		||||
    writePin(D5, layer_state_cmp(state, 1));
 | 
			
		||||
    gpio_write_pin(D5, layer_state_cmp(state, 1));
 | 
			
		||||
    return state;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool led_update_kb(led_t led_state) {
 | 
			
		||||
    bool res = led_update_user(led_state);
 | 
			
		||||
    if (res) {
 | 
			
		||||
        // writePin sets the pin high for 1 and low for 0.
 | 
			
		||||
        writePin(D4, led_state.caps_lock);
 | 
			
		||||
        // gpio_write_pin sets the pin high for 1 and low for 0.
 | 
			
		||||
        gpio_write_pin(D4, led_state.caps_lock);
 | 
			
		||||
    }
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue