NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Implementation of printf(...) function
| April 17, 2011 by caballeroroberto   | Hi, Do you know where I could find the implementation of the printf() function for the ATMega 168 chip? I am trying to understand how the FDEV_SETUP_STREAM() and uart_put/getchar() functions interact with it. I don't see how the FILE stream and charc c parameters in uart_putchar(char c, FILE stream) are passed. Thanks. | 
|---|---|
| April 17, 2011 by bretm   | Just search for "avr-lib source code" and you'll find it. It ends up calling vfprintf, which then makes multiple calls to putc, which just ends up calling uart_put or whatever other function is supplied when you create the stream structure. | 
Please log in to post a reply.
| 
Did you know that the sparks present in motors can be dangerous for your microcontroller and other electronics?  Learn more...
		 |