xilinx sdkでシリアルで一文字読み取り

https://forums.xilinx.com/t5/Embedded-Development-Tools/how-to-input-characters-from-console-why-getchar-works-not/td-p/26154

#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"


int main()
{
    init_platform();

    print("Hello World\n\r");
    setvbuf(stdin, NULL, _IONBF, 0);
    for (;;)
    {
      char input = getchar();
      if (input != EOF)
        xil_printf("%c", input);
    }
    cleanup_platform();
    return 0;
}