forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relocate usb_detach to utils (qmk#5121)
* Relocate usb_detach to utils * Relocate usb_detach to utils - fix up files after move
- Loading branch information
Showing
7 changed files
with
24 additions
and
105 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# the compiler: gcc for C program, define as g++ for C++ | ||
CC = gcc | ||
|
||
# compiler flags: | ||
# -g adds debugging information to the executable file | ||
# -Wall turns on most, but not all, compiler warnings | ||
CFLAGS = -g -Wall | ||
|
||
# the build target executable: | ||
TARGET = usb_detach | ||
|
||
all: $(TARGET) | ||
|
||
$(TARGET): $(TARGET).c | ||
$(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c | ||
|
||
clean: | ||
$(RM) $(TARGET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
# JJ40 Tools | ||
|
||
## usb_detach.c | ||
# usb_detach | ||
|
||
When trying to flash on Linux, you may encounter a "Resource Unavailable" error. This means that Linux's HID driver has taken exclusive control of the keyboard, and the program script can't flash it. | ||
This program can force Linux to give up a device, so that the programming script can reset it. | ||
|
||
### To compile: | ||
``` | ||
gcc usb_detach.c -o usb_detach | ||
## To compile: | ||
```bash | ||
make clean && make | ||
``` | ||
|
||
### To run: | ||
## To run: | ||
1. Use `lsusb` to discover the Bus and Device numbers for your keyboard. | ||
2. Run the program: `sudo ./usb_detach /dev/bus/usb/<BUS>/<DEVICE>`. | ||
3. Build and program the firmware as normal. |
1 change: 1 addition & 0 deletions
1
keyboards/ymd96/tools/usb_detach.c → util/usb_detach/usb_detach.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters