AnsweredAssumed Answered

InitStructure Significantly Changes USART Output

Question asked by cooper.ian on Mar 5, 2014
Latest reply on Mar 6, 2014 by Clive One
Hi all,

I'm hoping this is an easy one and just something I am missing. A google didn't return anything obviously relating to my problem.

I have some messy code that sets up my USART peripheral correctly. I have used    
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
...cast as global structures at the top of the script. Main then uses these to setup the usart and begin transmitting.

This works correctly. However, as my code grows I now have the need to put GPIO init in to it's own function. I noticed when doing this that having the USART_InitTypeDef USART_InitStructure; structure declared locally to the function the usart output did 'funny' things (not expected output). GPIO Init structure location seems to have no affect.

Please advise!
Thanks as always guys,