I’m trying to port an application written for a micro to Visual Studio so I can more easily run the debugger and scan through the code, rather than debug on the chip which is a bit of a pain when you want to learn how the application was written. I’m not at all a programming guru, and I keep getting this error, listed below, which is related to a structure:
error C2059: syntax error : '.'
The code is listed below, can anyone point me in the right direction.
typedef struct usart_reg_map
{
volatile uint32 SR;
volatile uint32 DR;
volatile uint32 BRR;
volatile uint32 CR1;
volatile uint32 CR2;
volatile uint32 CR3;
volatile uint32 GTPR;
}usart_reg_map;
#define USART1_BASE ((struct usart_reg_map*))
typedef struct usart_dev
{
usart_reg_map *regs;
}usart_dev;
struct usart_dev usart1 =
{
.regs = USART1_BASE,
};
usart_dev *USART1 = &usart1;