Various fixes for keyboards not implementing callbacks correctly (#24116)
This commit is contained in:
		
							parent
							
								
									e76069ea4e
								
							
						
					
					
						commit
						c0aca9f45c
					
				
					 8 changed files with 30 additions and 33 deletions
				
			
		| 
						 | 
				
			
			@ -19,16 +19,16 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		|||
#include "ps2.h"
 | 
			
		||||
#include "led.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool led_update_kb(led_t led_state)
 | 
			
		||||
{
 | 
			
		||||
    uint8_t ps2_led = 0;
 | 
			
		||||
    if (led_state.scroll_lock)
 | 
			
		||||
        ps2_led |= (1<<PS2_LED_SCROLL_LOCK);
 | 
			
		||||
    if (led_state.num_lock)
 | 
			
		||||
        ps2_led |= (1<<PS2_LED_NUM_LOCK);
 | 
			
		||||
    if (led_state.caps_lock)
 | 
			
		||||
        ps2_led |= (1<<PS2_LED_CAPS_LOCK);
 | 
			
		||||
    ps2_host_set_led(ps2_led);
 | 
			
		||||
bool led_update_kb(led_t led_state) {
 | 
			
		||||
    if(led_update_user(led_state)) {
 | 
			
		||||
        uint8_t ps2_led = 0;
 | 
			
		||||
        if (led_state.scroll_lock)
 | 
			
		||||
            ps2_led |= (1<<PS2_LED_SCROLL_LOCK);
 | 
			
		||||
        if (led_state.num_lock)
 | 
			
		||||
            ps2_led |= (1<<PS2_LED_NUM_LOCK);
 | 
			
		||||
        if (led_state.caps_lock)
 | 
			
		||||
            ps2_led |= (1<<PS2_LED_CAPS_LOCK);
 | 
			
		||||
        ps2_host_set_led(ps2_led);
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue