1 Reply Latest reply on Mar 7, 2013 1:53 PM by jasonrc

    Why are my prints delayed until rn is sent?

      [WICED-SDK-2.2.1]

       

       

      When I try to print to the uart, my prints do not come out until I send a

       

      . Why?

        • 1. Re: Why are my prints delayed until rn is sent?
          stdin/stdout is buffered by default.

           

           

          Buffering can be turned off as follows:

           

              setvbuf( stdin, NULL, _IONBF, 0 );
              setvbuf( stdout, NULL, _IONBF, 0 );
              setvbuf( stderr, NULL, _IONBF, 0 );
          

           

           

          Alternatively, you can flush stdout as required using:

           

              fflush(stdout);

           

           

          Example usage is shown in console.c in the iperf app.