aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/native
diff options
context:
space:
mode:
Diffstat (limited to 'src/platforms/native')
-rw-r--r--src/platforms/native/platform.c3
-rw-r--r--src/platforms/native/platform.h5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/platforms/native/platform.c b/src/platforms/native/platform.c
index 24eb79b..3bd0816 100644
--- a/src/platforms/native/platform.c
+++ b/src/platforms/native/platform.c
@@ -108,8 +108,6 @@ int platform_init(void)
systick_interrupt_enable();
systick_counter_enable();
- usbuart_init();
-
if (platform_hwversion() > 0) {
adc_init();
} else {
@@ -121,6 +119,7 @@ int platform_init(void)
SCB_VTOR = 0x2000; // Relocate interrupt vector table here
cdcacm_init();
+ usbuart_init();
jtag_scan(NULL);
diff --git a/src/platforms/native/platform.h b/src/platforms/native/platform.h
index a1471dc..eb91f8b 100644
--- a/src/platforms/native/platform.h
+++ b/src/platforms/native/platform.h
@@ -122,6 +122,7 @@ extern usbd_device *usbdev;
*/
#define IRQ_PRI_USB (2 << 4)
#define IRQ_PRI_USBUSART (1 << 4)
+#define IRQ_PRI_USBUSART_TIM (3 << 4)
#define IRQ_PRI_USB_VBUS (14 << 4)
#define IRQ_PRI_TRACE (0 << 4)
@@ -133,6 +134,10 @@ extern usbd_device *usbdev;
#define USBUSART_PORT GPIOA
#define USBUSART_TX_PIN GPIO9
#define USBUSART_ISR usart1_isr
+#define USBUSART_TIM TIM4
+#define USBUSART_TIM_CLK_EN() rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_TIM4EN)
+#define USBUSART_TIM_IRQ NVIC_TIM4_IRQ
+#define USBUSART_TIM_ISR tim4_isr
#define TRACE_TIM TIM3
#define TRACE_TIM_CLK_EN() rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_TIM3EN)