Skip to content

Commit

Permalink
New USB IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacehuhn committed Oct 7, 2022
1 parent c6e3f89 commit e4c5a45
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
*.exe
*.out
*.app

.vscode/

.vscode/

.DS_Store
build/
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
* Check your boards `arduino-cli board list`
* Compile `arduino-cli compile --profile adafruit_qtpy_m0`
* Upload `arduino-cli upload -p COM3`
* Compile and upload `arduino-cli compile --fqbn adafruit:samd:adafruit_qtpy_m0:opt=small,usbstack=tinyusb,debug=off -u -p COM3`
* Compile and upload `arduino-cli compile --fqbn adafruit:samd:adafruit_qtpy_m0:opt=small,usbstack=tinyusb,debug=off -u -p COM3`
* Compile export `arduino-cli compile --fqbn adafruit:samd:adafruit_qtpy_m0:opt=small,usbstack=tinyusb,debug=off --output-dir build/`
* Convert to uf2 `uf2conv build/USBNova.ino.bin -o build/USBNova.ino.uf2`
11 changes: 11 additions & 0 deletions src/duckparser/duckparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,17 @@ namespace duckparser {
line_list_destroy(l);
}

// https://github.com/hathach/tinyusb/blob/fd5bb6e5db8e8e997d66775e689cc73f149e7fc1/src/class/hid/hid.h#L153
// GAMEPAD PRESS button&dpad
// GAMEPAD RELEASE button&dpad
// GAMEPAD CLICK button&dpad / GAMEPAD button&dpad
// GAMEPAD direction amount

// Consumer
// https://github.com/hathach/tinyusb/blob/fd5bb6e5db8e8e997d66775e689cc73f149e7fc1/examples/device/hid_composite/src/main.c#L155
// KEYCODE 2bytecode
// Codes: https://github.com/hathach/tinyusb/blob/ae531a79f654d566790a4daae350730cdc0a01e9/src/class/hid/hid.h#L790

int getRepeats() {
return repeat_num;
}
Expand Down
18 changes: 9 additions & 9 deletions src/preferences/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace preferences {
bool enable_msc { false };
bool enable_led { true };

std::string hid_vid { "239A" };
std::string hid_pid { "80CB" };
std::string hid_vid { "16D0" };
std::string hid_pid { "11A4" };
std::string hid_rev { "0100" };

std::string msc_vid { "Adafruit" };
std::string msc_pid { "External Flash" };
std::string msc_rev { "1.0" };
std::string msc_vid { "SpHuhn" }; // max. 8 chars
std::string msc_pid { "USB Nova" }; // max. 16 chars
std::string msc_rev { "1.0" }; // max. 4 chars

std::string default_layout { "US" };
int default_delay { 5 };
Expand Down Expand Up @@ -198,12 +198,12 @@ namespace preferences {
enable_msc = false;
enable_led = true;

hid_vid = "239A";
hid_pid = "80CB";
hid_vid = "16D0";
hid_pid = "11A4";
hid_rev = "0100";

msc_vid = "Adafruit";
msc_pid = "External Flash";
msc_vid = "SpHuhn";
msc_pid = "USB Nova";
msc_rev = "1.0";

default_layout = "US";
Expand Down

0 comments on commit e4c5a45

Please sign in to comment.