// GPIO setup. LOCAL_EXP(GPIO,USB_PORT)->CFGLR = ( #ifdef BOOTLOADER_KEEP_PORT_CFG LOCAL_EXP(GPIO,USB_PORT)->CFGLR #else 0x44444444 // reset value (all input) #endif // Reset the USB Pins & ~( 0xF<<(4*USB_PIN_DP) | 0xF<<(4*USB_PIN_DM) #if defined(USB_PIN_DPU) && (PORTID_EQUALS(USB_DPU_PORT,USB_PORT) || !defined(USB_DPU_PORT)) | 0xF<<(4*USB_PIN_DPU) #endif // reset Bootloader Btn Pin #if defined(BOOTLOADER_BTN_PORT) && PORTID_EQUALS(BOOTLOADER_BTN_PORT,USB_PORT) | 0xF<<(4*BOOTLOADER_BTN_PIN) #endif ) ) | // Configure the USB Pins #ifdef USB_PIN_DPU (GPIO_Speed_50MHz | GPIO_CNF_OUT_PP)<<(4*USB_PIN_DPU) | #endif #if defined(BOOTLOADER_BTN_PORT) && PORTID_EQUALS(BOOTLOADER_BTN_PORT,USB_PORT) #if defined(BOOTLOADER_BTN_PULL) (GPIO_Speed_In | GPIO_CNF_IN_PUPD)<<(4*BOOTLOADER_BTN_PIN) | #else (GPIO_Speed_In | GPIO_CNF_IN_FLOATING)<<(4*BOOTLOADER_BTN_PIN) | #endif #endif (GPIO_Speed_In | GPIO_CNF_IN_PUPD)<<(4*USB_PIN_DP) | (GPIO_Speed_In | GPIO_CNF_IN_PUPD)<<(4*USB_PIN_DM);