Add LED feature to Sun converter
This commit is contained in:
		
							parent
							
								
									454f7bc716
								
							
						
					
					
						commit
						edce1d19a6
					
				
					 5 changed files with 74 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -16,10 +16,18 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		|||
*/
 | 
			
		||||
 | 
			
		||||
#include "stdint.h"
 | 
			
		||||
#include "serial.h"
 | 
			
		||||
#include "led.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void led_set(uint8_t usb_led)
 | 
			
		||||
{
 | 
			
		||||
    // not supported now
 | 
			
		||||
    uint8_t sun_led = 0;
 | 
			
		||||
    if (usb_led & (1<<USB_LED_NUM_LOCK))    sun_led |= (1<<0);
 | 
			
		||||
    if (usb_led & (1<<USB_LED_COMPOSE))     sun_led |= (1<<1);
 | 
			
		||||
    if (usb_led & (1<<USB_LED_SCROLL_LOCK)) sun_led |= (1<<2);
 | 
			
		||||
    if (usb_led & (1<<USB_LED_CAPS_LOCK))   sun_led |= (1<<3);
 | 
			
		||||
 | 
			
		||||
    serial_send(0x0E);
 | 
			
		||||
    serial_send(sun_led);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue