Writing a Variable as a string input to a function
Hi
I am currently trying to write c++ for the arm 7t using Metrowerks Codewarrior.
The issue im having is that the function to enable me to write via a COM port
connected to the arm7t only accepts strings.
for instance the function call would be
Code:
serial_print (COM0_USER, "you string here");
where com0_user is to define the port being used. This would then display that message on say windows terminal running on a host pc.
I need to use in in a similar way to say Cout. i.e being able to send a result from a calculation performed to the screen. Any ideas??
This is the deffinition of serial print:-
Code:
void serial_print (unsigned port, char *s)
{
while ( *s != 0 ) {
switch (port) {
case COM0_USER:
while ( TX_READY(GET_STATUS(UART0_BASE))==0);
PUT_CHAR(UART0_BASE,*s++);
break;
case COM1_DEBUG:
while ( TX_READY(GET_STATUS(UART1_BASE))==0);
PUT_CHAR(UART1_BASE,*s++);
break;
}
}
}
Any suggestions or ideas would be welcomed, thanks all for your help