Thank you so much, Chris! I just find the definition of "putchar" in my custom code, which does the USART job. But I cannot find the printf.c in my MSPGCC directory. So I guess mspgcc share the printf() function with gcc, which also called the "putchar()", am I right?
On Thu, May 27, 2010 at 8:26 PM, Chris Liechti <[email protected]> wrote: > Am 27.05.2010 23:04, schrieb Hao Wang: > > Does MSPGCC have support for printf() > > yes > > > which automatically send data through USART0? > > no. it just calls "putchar" which you have to implement yourself to do > what you want. > > something like that: > > int putchar(int character) { > while (!(UTCTL0 & TXEPT)) {} // wait util tx buffer is free > TXBUF0 = character; // send character > return 1; > } > > > Source? > > http://mspgcc.cvs.sourceforge.net/viewvc/mspgcc/msp430-libc/src/stdlib/ > > chris > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Mspgcc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > -- Wang Hao, 1400 Townsend Drive,EERC 121 Houghton,MI
