Skip to content

Commit 7aa1c08

Browse files
Use generic HID classes to minimize code duplic'n (#1254)
Move the Joystick, Keyboard, and Mouse into a base class which handles the operation/input, and a subclass which will implement the reporting as a HID device via USB, Bluetooth Classic, or Bluetooth Low Energy (BLE). Reduce copies of library code and makes maintainability much better.
1 parent 0be1d9c commit 7aa1c08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1668
-3108
lines changed

.gitmodules

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
path = libraries/ESP8266SdFat
1515
url = https://github.com/earlephilhower/ESP8266SdFat.git
1616
[submodule "libraries/Keyboard"]
17-
path = libraries/Keyboard
18-
url = https://github.com/earlephilhower/Keyboard
17+
path = libraries/HID_Keyboard
18+
url = https://github.com/earlephilhower/Keyboard.git
1919
[submodule "libraries/Mouse"]
20-
path = libraries/Mouse
21-
url = https://github.com/earlephilhower/Mouse
20+
path = libraries/HID_Mouse
21+
url = https://github.com/earlephilhower/Mouse.git
2222
[submodule "libraries/Joystick"]
23-
path = libraries/Joystick
24-
url = https://github.com/benjaminaigner/Joystick
23+
path = libraries/HID_Joystick
24+
url = https://github.com/earlephilhower/Joystick.git
2525
[submodule "libraries/Adafruit_TinyUSB_Arduino"]
2626
path = libraries/Adafruit_TinyUSB_Arduino
2727
url = https://github.com/adafruit/Adafruit_TinyUSB_Arduino.git

libraries/PicoBluetoothBLEHID/keywords.txt renamed to libraries/HID_Bluetooth/keywords.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Datatypes (KEYWORD1)
77
#######################################
88

9+
PicoBluetoothHID KEYWORD1
910
PicoBluetoothBLEHID KEYWORD1
1011

1112
#######################################
@@ -20,8 +21,10 @@ connected KEYWORD2
2021
send KEYWORD2
2122
lockBluetooth KEYWORD2
2223
unlockBluetooth KEYWORD2
24+
getCID KEYWORD2
2325
setBattery KEYWORD2
2426

2527
#######################################
2628
# Constants (LITERAL1)
2729
#######################################
30+
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name=PicoBluetoothBLEHID
1+
name=HID_Bluetooth
22
version=1.0.0
33
author=Earle F. Philhower, III <[email protected]>
44
maintainer=Earle F. Philhower, III <[email protected]>
5-
sentence=Implements a HID device base class for PicoW Bluetooth BLE
6-
paragraph=Implements a HID device base class for PicoW Bluetooth BLE
5+
sentence=Implements a HID device base class for PicoW Bluetooth
6+
paragraph=Implements a HID device base class for PicoW Bluetooth
77
category=Device Control
88
url=https://github.com/earlephilhower/arduino-pico
99
architectures=rp2040
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifdef ENABLE_CLASSIC
2+
#include "PicoBluetoothHID.h"
3+
#endif
4+
5+
#ifdef ENABLE_BLE
6+
#include "PicoBluetoothBLEHID.h"
7+
#endif

libraries/HID_Joystick

Submodule HID_Joystick added at 4eb3e28

libraries/HID_Keyboard

Submodule HID_Keyboard added at 74c3b2f

0 commit comments

Comments
 (0)