F410: multiple definition of `huart2';
HI there, i m using F410 Nucleo, and i keep getting these errors when using USART2, as I declare in 2 separe files i.e. main.c and buffer. could anyone advise how to resolve this?
error: multiple definition of `huart2';
//main.c
..
/* Private variables ---------------------------------------------------------*/
UART_HandleTypeDef huart2;
..
/* USER CODE END USART2_Init 1 */
huart2.Instance = USART2;
huart2.Init.BaudRate = 115200;
huart2.Init.WordLength = UART_WORDLENGTH_8B;
huart2.Init.StopBits = UART_STOPBITS_1;
huart2.Init.Parity = UART_PARITY_NONE;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart2.Init.OverSampling = UART_OVERSAMPLING_16;
// buffer.c
#include "buffer.h"
#include <string.h>
/**** define the UART ****/
UART_HandleTypeDef huart2; // woldes
#define uart &huart2
..
