Hi,
Is there any way (other than dealing with putchar() replacement directly) to do formatted output (via fdprintf, etc.) through a low level function of my own? I'm moving an older UART based project to use an FTDI async FIFO (8 bit bus) USB IC. There is a ton of formatted output code already in play. With the Rabbit Softools compiler, there was an Fassign function that let you point a file descriptor at any function, avoiding putchar() completely for any given descriptor. I remember with the Keil tools, I had to directly manipulate putchar(). How would I best address this with the NB tools?
Thanks,
Ray
Formatted I/O
Re: Formatted I/O
If I understand correctly, I think you can accomplish what you want by creating your own file descriptor GetExtraFD (in iointernal.h). You create an IoExpandStruct and define your own read, write, and close functions for that file descriptor. I used this method for creating file descriptors for an external quad uart chip.
Re: Formatted I/O
That looks like it's exactly what I need! There was nothing in the docs about it. Do you recall if they had any example code anywhere?
Thanks!
Ray
Thanks!
Ray
Re: Formatted I/O
No I don't think I ever found any examples, I just used the system library as a reference, there were a few places where they used that.
Re: Formatted I/O
Thank you! I'll search by function names there.