LPC1115 redirect printf/scanf to UART

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1115 redirect printf/scanf to UART

1,172 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mykbdj on Fri Feb 21 03:08:46 MST 2014
Hi,

I've defined the __sys_write() and __sys_readc() functions as following:

int __sys_write (int iFileHandle, char *pcBuffer, int iLength)
{
unsigned int i;
for (i = 0;i (less than) iLength; i++)
{
putchar(pcBuffer); // print each character
}
return iLength;
}

int __sys_readc (void)
{
char c = getchar();
return (int)c;
}


Edited this part.

Thanks!!
0 Kudos
Reply
3 Replies

1,065 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mykbdj on Fri Feb 21 03:42:35 MST 2014
Okay, I'm an idiot.  :~

I added stdio.h in a different file than I was compiling.

Fixed!
Thanks!!  :bigsmile:
0 Kudos
Reply

1,065 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Fri Feb 21 03:23:24 MST 2014

Quote: mykbdj
Any ideas what am I missing?



stdio.h  :quest:
0 Kudos
Reply

1,065 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mykbdj on Fri Feb 21 03:12:19 MST 2014
For some reason the post was being clipped right after the angled brackets. I had to replace it with (less than) to show the intent.

Thanks
0 Kudos
Reply