8 Replies Latest reply on Sep 20, 2015 12:09 PM by dakn_263916

    Printf with USBUART




      So, I'm trying to get the USBUART on a CY8CKIT-059 to act as a virtual COM port and I have everything working except being able to use printf().  


      I've read through other forum posts on the subject that recommend "modifying _write" function, but I'm not sure how to do that.  I think maybe the example was for a true UART or something because it didn't make much sense to me; like I'm missing some other declaration or header in the beginning to tie it all together.  I've been referring to:




      I have attached my whole test code, but below is the beginning:




      #include <device.h>
      #include "stdio.h"


      #if (CY_PSOC5LP)
      /* For GCC compiler revise _write() function */
      int _write(int file, char *ptr, int len)
              int i;
              for (i = 0; i < len; i++)
      #endif /* CY_PSOC5 */