From 5036de9e13cdf9accce13b37edf973eb84529eb9 Mon Sep 17 00:00:00 2001 From: skullY Date: Sun, 23 Apr 2017 14:47:48 -0700 Subject: [PATCH] Move the USB fix to boardInit() --- keyboards/simontester/boards/GENERIC_STM32_F04/board.c | 4 ++++ tmk_core/protocol/chibios/usb_main.c | 10 ---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/keyboards/simontester/boards/GENERIC_STM32_F04/board.c b/keyboards/simontester/boards/GENERIC_STM32_F04/board.c index 70b8151970..a1de2333d7 100644 --- a/keyboards/simontester/boards/GENERIC_STM32_F04/board.c +++ b/keyboards/simontester/boards/GENERIC_STM32_F04/board.c @@ -99,4 +99,8 @@ bool mmc_lld_is_write_protected(MMCDriver *mmcp) { * @todo Add your board-specific code, if any. */ void boardInit(void) { + /* Remap PA11->PA9 and PA12->PA10 for USB + */ + RCC->APB2ENR |= RCC_APB2ENR_SYSCFGCOMPEN; + SYSCFG->CFGR1 |= SYSCFG_CFGR1_PA11_PA12_RMP; } diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 667197200b..59edab9bd2 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -1035,16 +1035,6 @@ void init_usb_driver(USBDriver *usbp) { obqObjectInit(&console_buf_queue, console_queue_buffer, CONSOLE_EPSIZE, CONSOLE_QUEUE_CAPACITY, console_queue_onotify, (void*)usbp); chVTObjectInit(&console_flush_timer); #endif -#ifdef STM32_REMAP_PINS - /* Remap PA11->PA9 and PA12->PA10 on STM32 devices that require it. - * - * The following MCU's are known to require this: - * - * STM32F042x6 - */ - RCC->APB2ENR |= RCC_APB2ENR_SYSCFGCOMPEN; - SYSCFG->CFGR1 |= SYSCFG_CFGR1_PA11_PA12_RMP; -#endif } /*