]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - converter/sun_usb/led.c
Merge branch 'virtual_dipsw'
[max/tmk_keyboard.git] / converter / sun_usb / led.c
index 68ccc63527b08ae11cdaea686e89f05ad8abb74a..48c3f1c2b29224f09fa305cebf1822e0da673148 100644 (file)
@@ -22,5 +22,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 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);
 }