platform: Renamed cdcacm_init -> blackmagic_usb_init
This commit is contained in:
parent
105f6a3dce
commit
82bca86806
|
@ -69,7 +69,7 @@ void platform_init(void)
|
|||
|
||||
platform_timing_init();
|
||||
usbuart_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
}
|
||||
|
||||
void platform_nrst_set_val(bool assert)
|
||||
|
|
|
@ -108,7 +108,7 @@ void platform_init(void)
|
|||
|
||||
platform_timing_init();
|
||||
usbuart_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
|
||||
// https://github.com/libopencm3/libopencm3/pull/1256#issuecomment-779424001
|
||||
OTG_FS_GCCFG |= OTG_GCCFG_NOVBUSSENS | OTG_GCCFG_PWRDWN;
|
||||
|
|
|
@ -572,16 +572,13 @@ static void cdcacm_set_config(usbd_device *dev, uint16_t wValue)
|
|||
}
|
||||
|
||||
/* We need a special large control buffer for this device: */
|
||||
uint8_t usbd_control_buffer[256];
|
||||
static uint8_t usbd_control_buffer[256];
|
||||
|
||||
void cdcacm_init(void)
|
||||
void blackmagic_usb_init(void)
|
||||
{
|
||||
void exti15_10_isr(void);
|
||||
|
||||
serial_no_read(serial_no);
|
||||
|
||||
usbdev = usbd_init(&USB_DRIVER, &dev_desc, &config, usb_strings,
|
||||
sizeof(usb_strings)/sizeof(char *),
|
||||
usbdev = usbd_init(&USB_DRIVER, &dev_desc, &config, usb_strings, sizeof(usb_strings) / sizeof(char *),
|
||||
usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
|
||||
usbd_register_set_config_callback(usbdev, cdcacm_set_config);
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#define CDCACM_UART_ENDPOINT 3
|
||||
#define TRACE_ENDPOINT 5
|
||||
|
||||
void cdcacm_init(void);
|
||||
void blackmagic_usb_init(void);
|
||||
/* Returns current usb configuration, or 0 if not configured. */
|
||||
int cdcacm_get_config(void);
|
||||
int cdcacm_get_dtr(void);
|
||||
|
|
|
@ -84,7 +84,7 @@ void platform_init(void)
|
|||
gpio_set_output_options(NRST_PORT, GPIO_OTYPE_OD,
|
||||
GPIO_OSPEED_2MHZ, NRST_PIN);
|
||||
platform_timing_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
usbuart_init();
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void platform_init(void)
|
|||
/* Set up USB Pins and alternate function*/
|
||||
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO11 | GPIO12);
|
||||
gpio_set_af(GPIOA, GPIO_AF14, GPIO11 | GPIO12);
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
usbuart_init();
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ void platform_init(void)
|
|||
|
||||
platform_timing_init();
|
||||
usbuart_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
}
|
||||
|
||||
void platform_nrst_set_val(bool assert) { (void)assert; }
|
||||
|
|
|
@ -77,7 +77,7 @@ void platform_init(void)
|
|||
|
||||
platform_timing_init();
|
||||
usbuart_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
}
|
||||
|
||||
void platform_nrst_set_val(bool assert) { (void)assert; }
|
||||
|
|
|
@ -81,7 +81,7 @@ void platform_init(void)
|
|||
__asm__("nop"); __asm__("nop"); __asm__("nop");
|
||||
gpio_mode_setup(GPIOD_BASE, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO4|GPIO5);
|
||||
usbuart_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
|
||||
usb_enable_interrupts(USB_INT_RESET | USB_INT_DISCON |
|
||||
USB_INT_RESUME | USB_INT_SUSPEND, 0xff, 0xff);
|
||||
|
|
|
@ -223,7 +223,7 @@ void platform_init(void)
|
|||
SCB_VTOR = (uint32_t)&vector_table;
|
||||
|
||||
platform_timing_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
|
||||
/* On hardware version 1 and 2, UART and SWD share connector pins.
|
||||
* Don't enable UART if we're being debugged. */
|
||||
|
|
|
@ -80,7 +80,7 @@ void platform_init(void)
|
|||
platform_timing_init();
|
||||
if (rev > 1) /* Reconnect USB */
|
||||
gpio_set(GPIOA, GPIO15);
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
|
||||
#ifdef SWIM_AS_UART
|
||||
gpio_primary_remap(AFIO_MAPR_SWJ_CFG_FULL_SWJ,
|
||||
|
|
|
@ -109,7 +109,7 @@ void platform_init(void)
|
|||
SCB_VTOR = (uint32_t)&vector_table;
|
||||
|
||||
platform_timing_init();
|
||||
cdcacm_init();
|
||||
blackmagic_usb_init();
|
||||
usbuart_init();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue