AVR studio 6 C++ project to print string to uart.
This Hangs at the whie without doing the send
Puts_While("USART Test\r\n");
Puts_IF("USART Test\r\n");
void Puts_While(char *Buffer)
{
while(*Buffer > 0); // Send string
{
USART_SendByte( *Buffer++); // never hit
}
} // loops back to while here
This works..
void Puts_IF(char *Buffer)
{
sloop:
sbyte = *Buffer;
if (sbyte >> 0)
{
USART_SendByte( *Buffer++);
goto sloop;
}
}
char sbyte;
//char Buffer[4];
Thanks
suspect a optimization issue but don't know how to test. :?