12 Replies Latest reply on Jun 21, 2016 1:44 AM by user_1377889

    printf () functions how to redirect serial port  on the PSOC BLE

    Helon_chen_1478911

      Hi,all

         

        I want to use the Printf () function to print the serial port information.

         

      For example:

         

         Normal:

         

              UART_SpiUartPutArray("Helon Test\r\n",sizeof("Helon Test\r\n"));//Uart can print the serial port information.

         

        Now,i want to do like this:

         

              printf("Helon Test\r\n");//"Helon Test\r\n" receviced by serial tool.

         

      so,my question is how can i do to print the serial port information by printf() function?And the _Write () function has been rewrited,but printf("Helon Test\r\n") still can't print the serial port information.the _Write () function as follow:

         

      int _write(int file, char *ptr, int len)
      {
          int i;
          file = file;
          for (i = 0; i < len; i++)
          {
              UART_SpiUartWriteTxData(*ptr++);
          }
          return len;
      }