소스 검색

usb_usb: Restore LED state when plugging keyboard

master
tmk 7 년 전
부모
커밋
51326077b0
4개의 변경된 파일1592개의 추가작업 그리고 1565개의 파일을 삭제
  1. 1
    0
      converter/usb_usb/Makefile.unimap
  2. 1
    1
      converter/usb_usb/README
  3. 1578
    1564
      converter/usb_usb/binary/usb_usb_unimap.hex
  4. 12
    0
      converter/usb_usb/usb_usb.cpp

+ 1
- 0
converter/usb_usb/Makefile.unimap 파일 보기

@@ -1,4 +1,5 @@
TARGET = usb_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
#LUFA_DEBUG = yes
include Makefile

+ 1
- 1
converter/usb_usb/README 파일 보기

@@ -59,7 +59,6 @@ In case of Leonardo push reset button then run command. Serial port name(COM17)
Limitation
----------
Only supports 'HID Boot protocol'.
Not support keyboard LED yet.

Note that the converter can host only USB "boot protocol" keyboard(6KRO), not NKRO, it is possible to support NKRO keyboard but you will need to write HID report parser for that. Every NKRO keyboard can have different HID report and it is difficult to support all kind of NKRO keyboards in the market.

@@ -77,6 +76,7 @@ Update
------
2014/12/11 Added Hub support(confirmed with HHKB pro2)
2016/09/10 Unimap editor support
2016/10/18 Fix LED state at startup




+ 1578
- 1564
converter/usb_usb/binary/usb_usb_unimap.hex
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 12
- 0
converter/usb_usb/usb_usb.cpp 파일 보기

@@ -32,6 +32,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "timer.h"
#include "matrix.h"
#include "led.h"
#include "host.h"
#include "keyboard.h"


/* KEY CODE to Matrix
@@ -151,6 +153,16 @@ uint8_t matrix_scan(void) {
dprintf("host.Task: %d\n", timer);
}

static uint8_t usb_state = 0;
if (usb_state != usb_host.getUsbTaskState()) {
usb_state = usb_host.getUsbTaskState();
dprintf("usb_state: %02X\n", usb_state);

// restore LED state when keyboard comes up
if (usb_state == USB_STATE_RUNNING) {
keyboard_set_leds(host_keyboard_leds());
}
}
return 1;
}


Loading…
취소
저장