aboutsummaryrefslogtreecommitdiff
path: root/converter/x68k_usb/led.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-06-21 16:34:39 +0900
committertmk <nobody@nowhere>2013-06-22 02:32:45 +0900
commit42c962412b92a0ab4bd26c95f25867c645064bd6 (patch)
tree936222d372c4b36bc2fcae87bc9c7df0b08d41c6 /converter/x68k_usb/led.c
parent1f7461578dd489898389b7e9c488f7df9ac75399 (diff)
downloadqmk_firmware-42c962412b92a0ab4bd26c95f25867c645064bd6.tar.gz
qmk_firmware-42c962412b92a0ab4bd26c95f25867c645064bd6.zip
Add LED support to x68k
Diffstat (limited to 'converter/x68k_usb/led.c')
-rw-r--r--converter/x68k_usb/led.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/converter/x68k_usb/led.c b/converter/x68k_usb/led.c
index 40156cf4a..a1c1d546e 100644
--- a/converter/x68k_usb/led.c
+++ b/converter/x68k_usb/led.c
@@ -16,11 +16,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#include "stdint.h" 18#include "stdint.h"
19#include "x68k.h" 19#include "serial.h"
20#include "led.h" 20#include "led.h"
21#include "debug.h"
22#include "x68k.h"
21 23
22 24
23void led_set(uint8_t usb_led) 25void led_set(uint8_t usb_led)
24{ 26{
25 // not supported now 27 /* X68000 LED bits 0: on, 1: off
28 * bit 7 1(fixed)
29 * bit 6 全角
30 * bit 5 ひらがな
31 * bit 4 INS
32 * bit 3 CAPS
33 * bit 2 コード入力
34 * bit 1 ローマ字
35 * bit 0 かな
36 */
37 uint8_t led = 0xFF;
38 xprintf("usb_led: %02X\n", usb_led);
39 if (usb_led&(1<<USB_LED_NUM_LOCK)) led &= ~(1<<2);
40 if (usb_led&(1<<USB_LED_CAPS_LOCK)) led &= ~(1<<3);
41 if (usb_led&(1<<USB_LED_SCROLL_LOCK)) led &= ~(1<<1);
42 if (usb_led&(1<<USB_LED_COMPOSE)) led &= ~(1<<4);
43 if (usb_led&(1<<USB_LED_KANA)) led &= ~(1<<0);
44 xprintf("led: %02X\n", led);
45 x68k_send(led);
26} 46}