Merge pull request #287 from gsmcmullin/update_libopencm3
Update libopencm3
This commit is contained in:
commit
2db42ba8e5
|
@ -1 +1 @@
|
||||||
Subproject commit 67242de60dec0227739cd549e8a78e1a3c15dbf5
|
Subproject commit db7a8d71ca30dd9ce7947aa036897b910bdc4ad2
|
|
@ -62,7 +62,7 @@ void platform_init(void)
|
||||||
scb_reset_core();
|
scb_reset_core();
|
||||||
}
|
}
|
||||||
|
|
||||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_48MHZ]);
|
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_48MHZ]);
|
||||||
|
|
||||||
/* Enable peripherals */
|
/* Enable peripherals */
|
||||||
rcc_periph_clock_enable(RCC_OTGFS);
|
rcc_periph_clock_enable(RCC_OTGFS);
|
||||||
|
|
|
@ -46,7 +46,7 @@ void platform_init(void)
|
||||||
scb_reset_core();
|
scb_reset_core();
|
||||||
}
|
}
|
||||||
|
|
||||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_48MHZ]);
|
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_48MHZ]);
|
||||||
|
|
||||||
/* Enable peripherals */
|
/* Enable peripherals */
|
||||||
rcc_peripheral_enable_clock(&RCC_AHB2ENR, RCC_AHB2ENR_OTGFSEN);
|
rcc_peripheral_enable_clock(&RCC_AHB2ENR, RCC_AHB2ENR_OTGFSEN);
|
||||||
|
@ -103,4 +103,3 @@ void platform_request_boot(void)
|
||||||
SYSCFG_MEMRM &= ~3;
|
SYSCFG_MEMRM &= ~3;
|
||||||
SYSCFG_MEMRM |= 1;
|
SYSCFG_MEMRM |= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ static void adc_init(void)
|
||||||
gpio_set_mode(GPIOB, GPIO_MODE_INPUT,
|
gpio_set_mode(GPIOB, GPIO_MODE_INPUT,
|
||||||
GPIO_CNF_INPUT_ANALOG, GPIO0);
|
GPIO_CNF_INPUT_ANALOG, GPIO0);
|
||||||
|
|
||||||
adc_off(ADC1);
|
adc_power_off(ADC1);
|
||||||
adc_disable_scan_mode(ADC1);
|
adc_disable_scan_mode(ADC1);
|
||||||
adc_set_single_conversion_mode(ADC1);
|
adc_set_single_conversion_mode(ADC1);
|
||||||
adc_disable_external_trigger_regular(ADC1);
|
adc_disable_external_trigger_regular(ADC1);
|
||||||
|
@ -236,7 +236,7 @@ static void adc_init(void)
|
||||||
__asm__("nop");
|
__asm__("nop");
|
||||||
|
|
||||||
adc_reset_calibration(ADC1);
|
adc_reset_calibration(ADC1);
|
||||||
adc_calibration(ADC1);
|
adc_calibrate(ADC1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *platform_target_voltage(void)
|
const char *platform_target_voltage(void)
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN); \
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define USB_DRIVER stm32f103_usb_driver
|
#define USB_DRIVER st_usbfs_v1_usb_driver
|
||||||
#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ
|
#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ
|
||||||
#define USB_ISR usb_lp_can_rx0_isr
|
#define USB_ISR usb_lp_can_rx0_isr
|
||||||
/* Interrupt priorities. Low numbers are high priority.
|
/* Interrupt priorities. Low numbers are high priority.
|
||||||
|
|
|
@ -60,7 +60,7 @@ int main(void)
|
||||||
gpio_set_mode(LED_PORT, GPIO_MODE_OUTPUT_2_MHZ,
|
gpio_set_mode(LED_PORT, GPIO_MODE_OUTPUT_2_MHZ,
|
||||||
GPIO_CNF_OUTPUT_PUSHPULL, LED_0 | LED_1 | LED_2);
|
GPIO_CNF_OUTPUT_PUSHPULL, LED_0 | LED_1 | LED_2);
|
||||||
|
|
||||||
dfu_init(&stm32f103_usb_driver, DFU_MODE);
|
dfu_init(&st_usbfs_v1_usb_driver, DFU_MODE);
|
||||||
|
|
||||||
/* Configure the USB pull up pin. */
|
/* Configure the USB pull up pin. */
|
||||||
gpio_set(GPIOA, GPIO8);
|
gpio_set(GPIOA, GPIO8);
|
||||||
|
|
|
@ -58,7 +58,7 @@ int main(void)
|
||||||
|
|
||||||
if (rev > 1) /* Reconnect USB */
|
if (rev > 1) /* Reconnect USB */
|
||||||
gpio_set(GPIOA, GPIO15);
|
gpio_set(GPIOA, GPIO15);
|
||||||
dfu_init(&stm32f103_usb_driver, UPD_MODE);
|
dfu_init(&st_usbfs_v1_usb_driver, UPD_MODE);
|
||||||
|
|
||||||
dfu_main();
|
dfu_main();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
gpio_set_mode(USBUSART_PORT, GPIO_MODE_OUTPUT_2_MHZ, \
|
gpio_set_mode(USBUSART_PORT, GPIO_MODE_OUTPUT_2_MHZ, \
|
||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN);
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN);
|
||||||
|
|
||||||
#define USB_DRIVER stm32f103_usb_driver
|
#define USB_DRIVER st_usbfs_v1_usb_driver
|
||||||
#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ
|
#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ
|
||||||
#define USB_ISR usb_lp_can_rx0_isr
|
#define USB_ISR usb_lp_can_rx0_isr
|
||||||
/* Interrupt priorities. Low numbers are high priority.
|
/* Interrupt priorities. Low numbers are high priority.
|
||||||
|
|
|
@ -75,7 +75,7 @@ uint32_t detect_rev(void)
|
||||||
rev = 1;
|
rev = 1;
|
||||||
/* On Rev > 0 unconditionally activate MCO on PORTA8 with HSE! */
|
/* On Rev > 0 unconditionally activate MCO on PORTA8 with HSE! */
|
||||||
RCC_CFGR &= ~(0xf << 24);
|
RCC_CFGR &= ~(0xf << 24);
|
||||||
RCC_CFGR |= (RCC_CFGR_MCO_HSECLK << 24);
|
RCC_CFGR |= (RCC_CFGR_MCO_HSE << 24);
|
||||||
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
|
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
|
||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO8);
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO8);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ int main(void)
|
||||||
|
|
||||||
if (rev > 1)
|
if (rev > 1)
|
||||||
gpio_set(GPIOA, GPIO15);
|
gpio_set(GPIOA, GPIO15);
|
||||||
dfu_init(&stm32f103_usb_driver, DFU_MODE);
|
dfu_init(&st_usbfs_v1_usb_driver, DFU_MODE);
|
||||||
|
|
||||||
dfu_main();
|
dfu_main();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ void traceswo_init(void)
|
||||||
timer_ic_set_polarity(TRACE_TIM, TIM_IC2, TIM_IC_FALLING);
|
timer_ic_set_polarity(TRACE_TIM, TIM_IC2, TIM_IC_FALLING);
|
||||||
|
|
||||||
/* Trigger on Filtered Timer Input 1 (TI1FP1) */
|
/* Trigger on Filtered Timer Input 1 (TI1FP1) */
|
||||||
timer_slave_set_trigger(TRACE_TIM, TIM_SMCR_TS_IT1FP1);
|
timer_slave_set_trigger(TRACE_TIM, TIM_SMCR_TS_TI1FP1);
|
||||||
|
|
||||||
/* Slave reset mode: reset counter on trigger */
|
/* Slave reset mode: reset counter on trigger */
|
||||||
timer_slave_set_mode(TRACE_TIM, TIM_SMCR_SMS_RM);
|
timer_slave_set_mode(TRACE_TIM, TIM_SMCR_SMS_RM);
|
||||||
|
|
|
@ -72,7 +72,7 @@ void usbuart_init(void)
|
||||||
timer_set_mode(USBUSART_TIM, TIM_CR1_CKD_CK_INT,
|
timer_set_mode(USBUSART_TIM, TIM_CR1_CKD_CK_INT,
|
||||||
TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP);
|
TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP);
|
||||||
timer_set_prescaler(USBUSART_TIM,
|
timer_set_prescaler(USBUSART_TIM,
|
||||||
rcc_ppre2_frequency / USBUART_TIMER_FREQ_HZ * 2 - 1);
|
rcc_apb2_frequency / USBUART_TIMER_FREQ_HZ * 2 - 1);
|
||||||
timer_set_period(USBUSART_TIM,
|
timer_set_period(USBUSART_TIM,
|
||||||
USBUART_TIMER_FREQ_HZ / USBUART_RUN_FREQ_HZ - 1);
|
USBUART_TIMER_FREQ_HZ / USBUART_RUN_FREQ_HZ - 1);
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN); \
|
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USBUSART_TX_PIN); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define USB_DRIVER stm32f103_usb_driver
|
#define USB_DRIVER st_usbfs_v1_usb_driver
|
||||||
#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ
|
#define USB_IRQ NVIC_USB_LP_CAN_RX0_IRQ
|
||||||
#define USB_ISR usb_lp_can_rx0_isr
|
#define USB_ISR usb_lp_can_rx0_isr
|
||||||
/* Interrupt priorities. Low numbers are high priority.
|
/* Interrupt priorities. Low numbers are high priority.
|
||||||
|
|
|
@ -83,7 +83,7 @@ int main(void)
|
||||||
systick_interrupt_enable();
|
systick_interrupt_enable();
|
||||||
systick_counter_enable();
|
systick_counter_enable();
|
||||||
|
|
||||||
dfu_init(&stm32f103_usb_driver, DFU_MODE);
|
dfu_init(&st_usbfs_v1_usb_driver, DFU_MODE);
|
||||||
|
|
||||||
dfu_main();
|
dfu_main();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue