mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-22 12:28:03 +08:00
Merge remote branch 'paparazzi/master'
This commit is contained in:
+1
-1
@@ -138,7 +138,7 @@ else
|
||||
LDFLAGS = -D__thumb2__ -T$(LDSCRIPT) -nostartfiles -L$(GCC_LIB_DIR) -O$(OPT) --gc-sections
|
||||
endif
|
||||
LDFLAGS += -Wl,-Map=$(OBJDIR)/$(TARGET).map,--cref,--gc-sections
|
||||
LDLIBS += -lc -lm -lgcc -lcmsis -lstm32
|
||||
LDLIBS += -lc -lm -lgcc -lcmsis -lstm32 -lopencm3_stm32
|
||||
|
||||
CPFLAGS = -j .isr_vector -j .text -j .data
|
||||
CPFLAGS_BIN = -Obinary
|
||||
|
||||
@@ -24,17 +24,24 @@
|
||||
|
||||
#include "mcu.h"
|
||||
|
||||
#include BOARD_CONFIG
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stm32/gpio.h>
|
||||
#include <stm32/rcc.h>
|
||||
#include <stm32/flash.h>
|
||||
#include <stm32/misc.h>
|
||||
#ifdef USE_OPENCM3
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#endif
|
||||
|
||||
#include BOARD_CONFIG
|
||||
|
||||
void mcu_arch_init(void) {
|
||||
|
||||
#ifdef USE_OPENCM3
|
||||
rcc_clock_setup_in_hse_12mhz_out_72mhz();
|
||||
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
|
||||
return;
|
||||
#endif
|
||||
#ifdef HSE_TYPE_EXT_CLK
|
||||
#warning Using external clock
|
||||
/* Setup the microcontroller system.
|
||||
|
||||
@@ -29,6 +29,14 @@
|
||||
#include <stm32/gpio.h>
|
||||
#include "std.h"
|
||||
|
||||
#include BOARD_CONFIG
|
||||
|
||||
#ifdef USE_OPENCM3
|
||||
#define pprz_usart_set_baudrate(x, y) usart_set_baudrate(x, y)
|
||||
#else
|
||||
#define pprz_usart_set_baudrate(x, y) do { } while(0);
|
||||
#endif
|
||||
|
||||
#ifdef USE_UART1
|
||||
|
||||
volatile uint16_t uart1_rx_insert_idx, uart1_rx_extract_idx;
|
||||
@@ -74,6 +82,9 @@ void uart1_init( void ) {
|
||||
USART_Init(USART1, &usart);
|
||||
/* Enable USART1 Receive interrupts */
|
||||
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
|
||||
|
||||
pprz_usart_set_baudrate(USART1, UART1_BAUD);
|
||||
|
||||
/* Enable the USART1 */
|
||||
USART_Cmd(USART1, ENABLE);
|
||||
|
||||
@@ -197,6 +208,9 @@ void uart2_init( void ) {
|
||||
USART_Init(USART2, &usart);
|
||||
/* Enable USART2 Receive interrupts */
|
||||
USART_ITConfig(USART2, USART_IT_RXNE, ENABLE);
|
||||
|
||||
pprz_usart_set_baudrate(USART2, UART2_BAUD);
|
||||
|
||||
/* Enable the USART2 */
|
||||
USART_Cmd(USART2, ENABLE);
|
||||
|
||||
@@ -320,6 +334,9 @@ void uart3_init( void ) {
|
||||
USART_Init(USART3, &usart);
|
||||
/* Enable USART3 Receive interrupts */
|
||||
USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);
|
||||
|
||||
pprz_usart_set_baudrate(USART3, UART3_BAUD);
|
||||
|
||||
/* Enable the USART3 */
|
||||
USART_Cmd(USART3, ENABLE);
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
#define BOARD_HAS_BARO
|
||||
|
||||
#define USE_OPENCM3
|
||||
|
||||
#define HSE_TYPE_EXT_CLK
|
||||
#define STM32_RCC_MODE RCC_HSE_ON
|
||||
#define STM32_PLL_MULT RCC_PLLMul_6
|
||||
|
||||
Reference in New Issue
Block a user