summaryrefslogtreecommitdiff
path: root/hid/patches
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-11-19 23:28:23 +0300
committerDevaev Maxim <[email protected]>2020-11-20 00:15:18 +0300
commita77db72355c760eb38deb4c46a83fb7d3f2ed008 (patch)
tree208cd060c234fbfd77ef3c1879ed906950660bed /hid/patches
parent188de715153100806bc4a95f3888f6f03f1ede2f (diff)
multihid firmware
Diffstat (limited to 'hid/patches')
-rw-r--r--hid/patches/absmouse-win-fix.patch (renamed from hid/patches/absmouse.patch)0
-rw-r--r--hid/patches/no-hid-singletones.patch66
-rw-r--r--hid/patches/no-main.patch17
-rw-r--r--hid/patches/optional-usb-serial.patch (renamed from hid/patches/optional-serial.patch)8
4 files changed, 87 insertions, 4 deletions
diff --git a/hid/patches/absmouse.patch b/hid/patches/absmouse-win-fix.patch
index ac2226a1..ac2226a1 100644
--- a/hid/patches/absmouse.patch
+++ b/hid/patches/absmouse-win-fix.patch
diff --git a/hid/patches/no-hid-singletones.patch b/hid/patches/no-hid-singletones.patch
new file mode 100644
index 00000000..af971ea5
--- /dev/null
+++ b/hid/patches/no-hid-singletones.patch
@@ -0,0 +1,66 @@
+diff -u -r HID-Project/src/SingleReport/BootKeyboard.cpp _HID-Project/src/SingleReport/BootKeyboard.cpp
+--- HID-Project/src/SingleReport/BootKeyboard.cpp 2019-07-13 21:16:23.000000000 +0300
++++ _HID-Project/src/SingleReport/BootKeyboard.cpp 2020-11-17 18:59:36.618815374 +0300
+@@ -206,6 +206,6 @@
+ }
+
+
+-BootKeyboard_ BootKeyboard;
++//BootKeyboard_ BootKeyboard;
+
+
+diff -u -r HID-Project/src/SingleReport/BootKeyboard.h _HID-Project/src/SingleReport/BootKeyboard.h
+--- HID-Project/src/SingleReport/BootKeyboard.h 2019-07-13 21:16:23.000000000 +0300
++++ _HID-Project/src/SingleReport/BootKeyboard.h 2020-11-17 19:00:54.967113649 +0300
+@@ -80,6 +80,6 @@
+ uint8_t* featureReport;
+ int featureLength;
+ };
+-extern BootKeyboard_ BootKeyboard;
++//extern BootKeyboard_ BootKeyboard;
+
+
+diff -u -r HID-Project/src/SingleReport/BootMouse.cpp _HID-Project/src/SingleReport/BootMouse.cpp
+--- HID-Project/src/SingleReport/BootMouse.cpp 2019-07-13 21:16:23.000000000 +0300
++++ _HID-Project/src/SingleReport/BootMouse.cpp 2020-11-17 18:59:22.859113905 +0300
+@@ -139,6 +139,6 @@
+ }
+ }
+
+-BootMouse_ BootMouse;
++//BootMouse_ BootMouse;
+
+
+diff -u -r HID-Project/src/SingleReport/BootMouse.h _HID-Project/src/SingleReport/BootMouse.h
+--- HID-Project/src/SingleReport/BootMouse.h 2019-07-13 21:16:23.000000000 +0300
++++ _HID-Project/src/SingleReport/BootMouse.h 2020-11-17 19:01:04.076915591 +0300
+@@ -48,6 +48,6 @@
+
+ virtual void SendReport(void* data, int length) override;
+ };
+-extern BootMouse_ BootMouse;
++//extern BootMouse_ BootMouse;
+
+
+diff -u -r HID-Project/src/SingleReport/SingleAbsoluteMouse.cpp _HID-Project/src/SingleReport/SingleAbsoluteMouse.cpp
+--- HID-Project/src/SingleReport/SingleAbsoluteMouse.cpp 2020-11-17 18:39:35.314843889 +0300
++++ _HID-Project/src/SingleReport/SingleAbsoluteMouse.cpp 2020-11-17 18:59:12.189345326 +0300
+@@ -139,6 +139,6 @@
+ USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, length);
+ }
+
+-SingleAbsoluteMouse_ SingleAbsoluteMouse;
++//SingleAbsoluteMouse_ SingleAbsoluteMouse;
+
+
+diff -u -r HID-Project/src/SingleReport/SingleAbsoluteMouse.h _HID-Project/src/SingleReport/SingleAbsoluteMouse.h
+--- HID-Project/src/SingleReport/SingleAbsoluteMouse.h 2019-07-13 21:16:23.000000000 +0300
++++ _HID-Project/src/SingleReport/SingleAbsoluteMouse.h 2020-11-17 19:01:21.356539808 +0300
+@@ -49,6 +49,6 @@
+
+ virtual inline void SendReport(void* data, int length) override;
+ };
+-extern SingleAbsoluteMouse_ SingleAbsoluteMouse;
++//extern SingleAbsoluteMouse_ SingleAbsoluteMouse;
+
+
diff --git a/hid/patches/no-main.patch b/hid/patches/no-main.patch
new file mode 100644
index 00000000..5c645480
--- /dev/null
+++ b/hid/patches/no-main.patch
@@ -0,0 +1,17 @@
+diff -u -r framework-arduino-avr/cores/arduino/main.cpp _framework-arduino-avr/cores/arduino/main.cpp
+--- framework-arduino-avr/cores/arduino/main.cpp 2019-05-16 15:52:01.000000000 +0300
++++ _framework-arduino-avr/cores/arduino/main.cpp 2020-11-17 18:56:01.243474508 +0300
+@@ -30,6 +30,7 @@
+ void setupUSB() __attribute__((weak));
+ void setupUSB() { }
+
++/*
+ int main(void)
+ {
+ init();
+@@ -49,4 +50,5 @@
+
+ return 0;
+ }
++*/
+
diff --git a/hid/patches/optional-serial.patch b/hid/patches/optional-usb-serial.patch
index 94dd1d72..0d4a0b37 100644
--- a/hid/patches/optional-serial.patch
+++ b/hid/patches/optional-usb-serial.patch
@@ -5,7 +5,7 @@ https://github.com/arduino-libraries/MIDIUSB/issues/50#issuecomment-451427496
return obj;
}
-+#ifndef NO_SERIAL
++#ifndef NO_USB_SERIAL
PluggableUSB_::PluggableUSB_() : lastIf(CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT),
lastEp(CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT),
+#else
@@ -22,7 +22,7 @@ diff -u -r a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp
{
0, // Control Endpoint
-+#ifndef NO_SERIAL
++#ifndef NO_USB_SERIAL
EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM
EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT
EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN
@@ -34,7 +34,7 @@ diff -u -r a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp
{
u8 i = setup.wIndex;
-+#ifndef NO_SERIAL
++#ifndef NO_USB_SERIAL
if (CDC_ACM_INTERFACE == i)
return CDC_Setup(setup);
+#endif
@@ -45,7 +45,7 @@ diff -u -r a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp
{
u8 interfaces = 0;
-+#ifndef NO_SERIAL
++#ifndef NO_USB_SERIAL
CDC_GetInterface(&interfaces);
+#endif