Skip to content

Commit

Permalink
Convert V-USB usbdrv to a submodule (#8321)
Browse files Browse the repository at this point in the history
* Convert V-USB usbdrv to a submodule

* Fix for Command feature and iWRAP

* Command does not even need this header, in fact

* Add ChangeLog entry
  • Loading branch information
fauxpark authored and noroadsleft committed May 15, 2020
1 parent 00b16bc commit d127bfe
Show file tree
Hide file tree
Showing 33 changed files with 52 additions and 7,417 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "lib/lufa"]
path = lib/lufa
url = https://github.com/qmk/lufa
[submodule "lib/vusb"]
path = lib/vusb
url = https://github.com/obdev/v-usb
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ ifndef SKIP_GIT
if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 50 --init lib/chibios-contrib; fi
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 50 --init lib/ugfx; fi
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 50 --init lib/lufa; fi
if [ ! -e lib/vusb ]; then git submodule sync lib/vusb && git submodule update --depth 50 --init lib/vusb; fi
git submodule status --recursive 2>/dev/null | \
while IFS= read -r x; do \
case "$$x" in \
Expand Down
5 changes: 5 additions & 0 deletions docs/ChangeLog/20200530/PR8321.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Converting V-USB usbdrv to a submodule

[#8321](https://github.com/qmk/qmk_firmware/pull/8321) and [qmk_compiler#62](https://github.com/qmk/qmk_compiler/pull/62).

These PRs move the V-USB driver code out of the qmk_firmware repository and into a submodule pointed at https://github.com/obdev/v-usb. This will make it easier to update the codebase if needed, while applying any potential QMK-specific modifications by forking it to the QMK GitHub organization.
1 change: 1 addition & 0 deletions lib/vusb
Submodule vusb added at 9a42d2
4 changes: 0 additions & 4 deletions tmk_core/common/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# include "mousekey.h"
#endif

#ifdef PROTOCOL_VUSB
# include "usbdrv.h"
#endif

#ifdef AUDIO_ENABLE
# include "audio.h"
#endif /* AUDIO_ENABLE */
Expand Down
18 changes: 12 additions & 6 deletions tmk_core/protocol/iwrap.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ VPATH += $(TMK_DIR)/protocol/iwrap
# V-USB
#
VUSB_DIR = protocol/vusb
OPT_DEFS += -DPROTOCOL_VUSB
SRC += $(VUSB_DIR)/vusb.c \
$(VUSB_DIR)/usbdrv/usbdrv.c \
$(VUSB_DIR)/usbdrv/usbdrvasm.S \
$(VUSB_DIR)/usbdrv/oddebug.c
VPATH += $(TMK_DIR)/protocol/vusb:$(TMK_DIR)/protocol/vusb/usbdrv

# Path to the V-USB library
VUSB_PATH = $(LIB_PATH)/vusb

SRC += $(VUSB_DIR)/vusb.c \
$(VUSB_PATH)/usbdrv/usbdrv.c \
$(VUSB_PATH)/usbdrv/usbdrvasm.S \
$(VUSB_PATH)/usbdrv/oddebug.c

# Search Path
VPATH += $(TMK_PATH)/$(VUSB_DIR)
VPATH += $(VUSB_PATH)

OPT_DEFS += -DPROTOCOL_VUSB
2 changes: 1 addition & 1 deletion tmk_core/protocol/iwrap/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "iwrap.h"
#ifdef PROTOCOL_VUSB
# include "vusb.h"
# include "usbdrv.h"
# include <usbdrv/usbdrv.h>
#endif
#include "uart.h"
#include "suart.h"
Expand Down
16 changes: 9 additions & 7 deletions tmk_core/protocol/vusb.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
VUSB_DIR = protocol/vusb

OPT_DEFS += -DPROTOCOL_VUSB
# Path to the V-USB library
VUSB_PATH = $(LIB_PATH)/vusb

SRC += $(VUSB_DIR)/main.c \
SRC += $(VUSB_DIR)/main.c \
$(VUSB_DIR)/vusb.c \
$(VUSB_DIR)/usbdrv/usbdrv.c \
$(VUSB_DIR)/usbdrv/usbdrvasm.S \
$(VUSB_DIR)/usbdrv/oddebug.c

$(VUSB_PATH)/usbdrv/usbdrv.c \
$(VUSB_PATH)/usbdrv/usbdrvasm.S \
$(VUSB_PATH)/usbdrv/oddebug.c

ifneq ($(strip $(CONSOLE_ENABLE)), yes)
ifndef NO_UART
Expand All @@ -18,4 +18,6 @@ endif

# Search Path
VPATH += $(TMK_PATH)/$(VUSB_DIR)
VPATH += $(TMK_PATH)/$(VUSB_DIR)/usbdrv
VPATH += $(VUSB_PATH)

OPT_DEFS += -DPROTOCOL_VUSB
4 changes: 2 additions & 2 deletions tmk_core/protocol/vusb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <avr/wdt.h>
#include <avr/sleep.h>
#include <util/delay.h>
#include "usbdrv.h"
#include "oddebug.h"
#include <usbdrv/usbdrv.h>
#include <usbdrv/oddebug.h>
#include "vusb.h"
#include "keyboard.h"
#include "host.h"
Expand Down
2 changes: 1 addition & 1 deletion tmk_core/protocol/vusb/sendchar_usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
*/
#include <stdint.h>
#include "oddebug.h"
#include <usbdrv/oddebug.h>
#include "sendchar.h"

#if DEBUG_LEVEL > 0
Expand Down
Loading

0 comments on commit d127bfe

Please sign in to comment.