Skip to content

Commit

Permalink
Add a custom USB driver for ARM (qmk#2750)
Browse files Browse the repository at this point in the history
* Copy Chibios serial_usb_driver into the chibios/protocol

It's renamed to usb_driver to avoid name conflicts

* Make the usb driver compile

* Disable ChibiOS serial usb driver for all keyboards

* Change usb_main to use QMKUSBDriver

* Initialize the usb driver buffers

* Add support for fixed size queues

* Fix USB driver initialization

* Don't transfer an empty packet for fixed size streams
  • Loading branch information
fredizzimo authored and carlpehrson committed May 7, 2018
1 parent af1024d commit bf3533d
Show file tree
Hide file tree
Showing 13 changed files with 738 additions and 51 deletions.
2 changes: 1 addition & 1 deletion keyboards/chibios_test/stm32_f072_onekey/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/chibios_test/stm32_f103_onekey/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/chibios_test/teensy_lc_onekey/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/clueboard/60/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ergodox_infinity/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/infinity60/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/jm60/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/k_type/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion keyboards/whitefox/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB TRUE
#define HAL_USE_SERIAL_USB FALSE
#endif

/**
Expand Down
1 change: 1 addition & 0 deletions tmk_core/protocol/chibios.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHIBIOS_DIR = $(PROTOCOL_DIR)/chibios
SRC += $(CHIBIOS_DIR)/usb_main.c
SRC += $(CHIBIOS_DIR)/main.c
SRC += usb_descriptor.c
SRC += $(CHIBIOS_DIR)/usb_driver.c

VPATH += $(TMK_PATH)/$(PROTOCOL_DIR)
VPATH += $(TMK_PATH)/$(CHIBIOS_DIR)
Expand Down
Loading

0 comments on commit bf3533d

Please sign in to comment.