]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
vusb: Fix keyboard_protocol and keyboard_idle #547
authortmk <hasu@tmk-kbd.com>
Mon, 27 Jul 2020 01:02:38 +0000 (10:02 +0900)
committertmk <hasu@tmk-kbd.com>
Mon, 27 Jul 2020 01:02:38 +0000 (10:02 +0900)
tmk_core/common/host.h
tmk_core/protocol/vusb/vusb.c

index 9814b10d2d0855b9aeea6d6e4cdcd31794051bcf..fefb8141903da84f036b85cae97c19ec8a97c1e2 100644 (file)
@@ -32,6 +32,9 @@ extern "C" {
 extern bool keyboard_nkro;
 #endif
 
+/* These parameters should be included into host driver also?
+ * keyboard_protocol: 0:Boot, 1:Report(default)
+ * keyboard_idle: idle rate in unit of 4ms */
 extern uint8_t keyboard_idle;
 extern uint8_t keyboard_protocol;
 
index 5d00165c0ac6f643bff0c789447b321ab8531479..7692a26e51b26c0b15683c18377c9863fae2ad01 100644 (file)
@@ -26,8 +26,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "vusb.h"
 
 
+/* host.h */
+uint8_t keyboard_protocol=1;
+uint8_t keyboard_idle = 0;
+
 static uint8_t vusb_keyboard_leds = 0;
-static uint8_t vusb_idle_rate = 0;
 
 /* Keyboard report send buffer */
 #define KBUF_SIZE 16
@@ -179,13 +182,13 @@ usbRequest_t    *rq = (void *)data;
             return sizeof(keyboard_report);
         }else if(rq->bRequest == USBRQ_HID_GET_IDLE){
             debug("GET_IDLE: ");
-            //debug_hex(vusb_idle_rate);
-            usbMsgPtr = &vusb_idle_rate;
+            //debug_hex(keyboard_idle);
+            usbMsgPtr = &keyboard_idle;
             return 1;
         }else if(rq->bRequest == USBRQ_HID_SET_IDLE){
-            vusb_idle_rate = rq->wValue.bytes[1];
+            keyboard_idle = rq->wValue.bytes[1];
             debug("SET_IDLE: ");
-            debug_hex(vusb_idle_rate);
+            debug_hex(keyboard_idle);
         }else if(rq->bRequest == USBRQ_HID_SET_REPORT){
             debug("SET_REPORT: ");
             // Report Type: 0x02(Out)/ReportID: 0x00(none) && Interface: 0(keyboard)