From 8bb3b2339f9589f5009c9dfd65af92749ebe59a5 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Sat, 19 Dec 2015 02:00:42 +0100 Subject: [PATCH 1/7] RawHID >64 byte fix --- Readme.md | 3 +++ src/SingleReport/BootKeyboard.cpp | 6 +++--- src/SingleReport/RawHID.cpp | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 34c0fc3..8d4da5f 100644 --- a/Readme.md +++ b/Readme.md @@ -49,6 +49,9 @@ www.nicohood.de Version History =============== ``` +2.4.2 Release (xx.xx.2016) +* RawHID >64 byte fix + 2.4.1 Release (19.12.2015) * RawHID Improvements * Added Keyboard Feature Report diff --git a/src/SingleReport/BootKeyboard.cpp b/src/SingleReport/BootKeyboard.cpp index 0261b41..81e3c8c 100644 --- a/src/SingleReport/BootKeyboard.cpp +++ b/src/SingleReport/BootKeyboard.cpp @@ -152,7 +152,7 @@ bool BootKeyboard_::setup(USBSetup& setup) // except the host tries to send more then 32k bytes. // We dont have that much ram anyways. if (length == featureLength) { - USB_RecvControl(featureReport, featureLength); + USB_RecvControlLong(featureReport, featureLength); // Block until data is read (make length negative) disableFeatureReport(); @@ -164,7 +164,7 @@ bool BootKeyboard_::setup(USBSetup& setup) // Output (set led states) else if(setup.wValueH == HID_REPORT_TYPE_OUTPUT){ if(length == sizeof(leds)){ - USB_RecvControl(&leds, length); + USB_RecvControlLong(&leds, length); return true; } } @@ -173,7 +173,7 @@ bool BootKeyboard_::setup(USBSetup& setup) else if(setup.wValueH == HID_REPORT_TYPE_INPUT) { if(length == sizeof(_keyReport)){ - USB_RecvControl(&_keyReport, length); + USB_RecvControlLong(&_keyReport, length); return true; } } diff --git a/src/SingleReport/RawHID.cpp b/src/SingleReport/RawHID.cpp index d4aa4d1..1f9a4de 100644 --- a/src/SingleReport/RawHID.cpp +++ b/src/SingleReport/RawHID.cpp @@ -123,7 +123,7 @@ bool RawHID_::setup(USBSetup& setup) // except the host tries to send more then 32k bytes. // We dont have that much ram anyways. if (length == featureLength) { - USB_RecvControl(featureReport, featureLength); + USB_RecvControlLong(featureReport, featureLength); // Block until data is read (make length negative) disableFeatureReport(); @@ -135,7 +135,7 @@ bool RawHID_::setup(USBSetup& setup) else if(setup.wValueH == HID_REPORT_TYPE_OUTPUT){ if(!dataAvailable && length <= dataLength){ // Write data to fit to the end (not the beginning) of the array - USB_RecvControl(data + dataLength - length, length); + USB_RecvControlLong(data + dataLength - length, length); dataAvailable = length; return true; } From bb0960c9f3063cae9a245fc48c1d2536c1264d6c Mon Sep 17 00:00:00 2001 From: NicoHood Date: Sat, 19 Dec 2015 02:02:11 +0100 Subject: [PATCH 2/7] Bump version number to 2.4.2 --- Readme.md | 2 +- library.properties | 2 +- src/HID-Project.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 8d4da5f..4a4d1af 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -Arduino HID Project 2.4.1 +Arduino HID Project 2.4.2 ========================= ![Header Picture](header.jpg) diff --git a/library.properties b/library.properties index 0dd202d..e7f574a 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=HID-Project -version=2.4.1 +version=2.4.2 author=NicoHood maintainer=NicoHood sentence=Extended HID Functions for Arduino diff --git a/src/HID-Project.h b/src/HID-Project.h index 5393c34..5e9ae12 100644 --- a/src/HID-Project.h +++ b/src/HID-Project.h @@ -25,10 +25,10 @@ THE SOFTWARE. #pragma once // Software version -#define HID_PROJECT_VERSION 241 +#define HID_PROJECT_VERSION 242 -#if ARDUINO < 10607 -#error HID Project requires Arduino IDE 1.6.7 or greater. Please update your IDE. +#if ARDUINO < 10608 +#error HID Project requires Arduino IDE 1.6.8 or greater. Please update your IDE. #endif #if !defined(USBCON) From 14f52f1879321699c666a089580ddbeb878be4a9 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Mon, 4 Jan 2016 18:13:30 +0100 Subject: [PATCH 3/7] Partly revert commit 8bb3b2339f9589f5009c9dfd65af92749ebe59a5 Arduino integrated the function now as normal fix --- src/SingleReport/BootKeyboard.cpp | 6 +++--- src/SingleReport/RawHID.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SingleReport/BootKeyboard.cpp b/src/SingleReport/BootKeyboard.cpp index 81e3c8c..0261b41 100644 --- a/src/SingleReport/BootKeyboard.cpp +++ b/src/SingleReport/BootKeyboard.cpp @@ -152,7 +152,7 @@ bool BootKeyboard_::setup(USBSetup& setup) // except the host tries to send more then 32k bytes. // We dont have that much ram anyways. if (length == featureLength) { - USB_RecvControlLong(featureReport, featureLength); + USB_RecvControl(featureReport, featureLength); // Block until data is read (make length negative) disableFeatureReport(); @@ -164,7 +164,7 @@ bool BootKeyboard_::setup(USBSetup& setup) // Output (set led states) else if(setup.wValueH == HID_REPORT_TYPE_OUTPUT){ if(length == sizeof(leds)){ - USB_RecvControlLong(&leds, length); + USB_RecvControl(&leds, length); return true; } } @@ -173,7 +173,7 @@ bool BootKeyboard_::setup(USBSetup& setup) else if(setup.wValueH == HID_REPORT_TYPE_INPUT) { if(length == sizeof(_keyReport)){ - USB_RecvControlLong(&_keyReport, length); + USB_RecvControl(&_keyReport, length); return true; } } diff --git a/src/SingleReport/RawHID.cpp b/src/SingleReport/RawHID.cpp index 1f9a4de..d4aa4d1 100644 --- a/src/SingleReport/RawHID.cpp +++ b/src/SingleReport/RawHID.cpp @@ -123,7 +123,7 @@ bool RawHID_::setup(USBSetup& setup) // except the host tries to send more then 32k bytes. // We dont have that much ram anyways. if (length == featureLength) { - USB_RecvControlLong(featureReport, featureLength); + USB_RecvControl(featureReport, featureLength); // Block until data is read (make length negative) disableFeatureReport(); @@ -135,7 +135,7 @@ bool RawHID_::setup(USBSetup& setup) else if(setup.wValueH == HID_REPORT_TYPE_OUTPUT){ if(!dataAvailable && length <= dataLength){ // Write data to fit to the end (not the beginning) of the array - USB_RecvControlLong(data + dataLength - length, length); + USB_RecvControl(data + dataLength - length, length); dataAvailable = length; return true; } From 8e5d8571e2090e8283a1059a9c4f663ee33dd3b9 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Mon, 4 Jan 2016 18:14:14 +0100 Subject: [PATCH 4/7] Bump Arduino IDE requirement number --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 4a4d1af..dd27782 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,7 @@ This project went through a lot of phases and has now reached a new Arduino ~~US with a lot of new functions like extended HID. It also supports HoodLoader1+2. The idea is to enable enhanced USB functions to almost all 'standard' Arduino boards. -**Supported Arduinos (IDE 1.6.6 or higher!):** +**Supported Arduinos (IDE 1.6.8 or higher!):** * Uno (with [HoodLoader2](https://github.com/NicoHood/HoodLoader2)) * Mega (with [HoodLoader2](https://github.com/NicoHood/HoodLoader2)) * Leonardo From f96e09c75b32e67df5fe4a964b8e7ad29af7eebe Mon Sep 17 00:00:00 2001 From: NicoHood Date: Mon, 4 Jan 2016 18:22:09 +0100 Subject: [PATCH 5/7] Fixed Keyboard modifier add() issue #68 --- Readme.md | 3 ++- src/HID-APIs/DefaultKeyboardAPI.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index dd27782..d36def5 100644 --- a/Readme.md +++ b/Readme.md @@ -50,7 +50,8 @@ Version History =============== ``` 2.4.2 Release (xx.xx.2016) -* RawHID >64 byte fix +* RawHID >64 byte fix (Arduino IDE 1.6.8 fix) +* Fixed Keyboard modifier add() issue #68 2.4.1 Release (19.12.2015) * RawHID Improvements diff --git a/src/HID-APIs/DefaultKeyboardAPI.hpp b/src/HID-APIs/DefaultKeyboardAPI.hpp index 7ca2071..06a1cab 100644 --- a/src/HID-APIs/DefaultKeyboardAPI.hpp +++ b/src/HID-APIs/DefaultKeyboardAPI.hpp @@ -33,7 +33,7 @@ size_t DefaultKeyboardAPI::set(KeyboardKeycode k, bool s) // Convert key into bitfield (0 - 7) k = KeyboardKeycode(uint8_t(k) - uint8_t(KEY_LEFT_CTRL)); if(s){ - _keyReport.modifiers = (1 << k); + _keyReport.modifiers |= (1 << k); } else{ _keyReport.modifiers &= ~(1 << k); From dced0978080a783609895fea45d2279d9d0f27c5 Mon Sep 17 00:00:00 2001 From: NicoHood Date: Mon, 4 Jan 2016 18:24:49 +0100 Subject: [PATCH 6/7] Lowered Arduiono IDE dependency to 1.6.7 again RawHID is fixed with 1.6.8, but its not essential for the whole library. However 1.6.8 is recommended. --- src/HID-Project.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HID-Project.h b/src/HID-Project.h index 5e9ae12..275af76 100644 --- a/src/HID-Project.h +++ b/src/HID-Project.h @@ -27,8 +27,8 @@ THE SOFTWARE. // Software version #define HID_PROJECT_VERSION 242 -#if ARDUINO < 10608 -#error HID Project requires Arduino IDE 1.6.8 or greater. Please update your IDE. +#if ARDUINO < 10607 +#error HID Project requires Arduino IDE 1.6.7 or greater. Please update your IDE. #endif #if !defined(USBCON) From 93a27986f82132f621c35c2abd3ced1c7664f6eb Mon Sep 17 00:00:00 2001 From: NicoHood Date: Mon, 4 Jan 2016 18:41:06 +0100 Subject: [PATCH 7/7] Release 2.4.2 --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index d36def5..7efeb98 100644 --- a/Readme.md +++ b/Readme.md @@ -49,7 +49,7 @@ www.nicohood.de Version History =============== ``` -2.4.2 Release (xx.xx.2016) +2.4.2 Release (04.01.2016) * RawHID >64 byte fix (Arduino IDE 1.6.8 fix) * Fixed Keyboard modifier add() issue #68