From c232882fda0669e28312446feac3cadb254962e8 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 26 Jun 2021 11:48:48 +0100 Subject: [PATCH] Allow configuration of USB_VBUS_PIN on chibios (#13342) --- tmk_core/common/chibios/chibios_config.h | 4 +++- tmk_core/common/usb_util.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tmk_core/common/chibios/chibios_config.h b/tmk_core/common/chibios/chibios_config.h index 1d8ace49556..23c65f94284 100644 --- a/tmk_core/common/chibios/chibios_config.h +++ b/tmk_core/common/chibios/chibios_config.h @@ -15,7 +15,9 @@ */ #pragma once -#define SPLIT_USB_DETECT // Force this on for now +#ifndef USB_VBUS_PIN +# define SPLIT_USB_DETECT // Force this on when dedicated pin is not used +#endif #if defined(STM32F1XX) # define USE_GPIOV1 diff --git a/tmk_core/common/usb_util.c b/tmk_core/common/usb_util.c index e4c50fcb10a..d4134a04465 100644 --- a/tmk_core/common/usb_util.c +++ b/tmk_core/common/usb_util.c @@ -13,8 +13,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include "quantum.h" #include "usb_util.h" -#include "wait.h" __attribute__((weak)) void usb_disable(void) {} __attribute__((weak)) bool usb_connected_state(void) { return true; }