Thanks for support. I used registers so everything is ok for now. I'm using my own custom board with Altera MAX10 :)
From the other hand in the meanwhile I used something like this and it works great for my purpose:
while(1) {
ch = alt_getchar();
if(ch != 0x11 && ch != 0x13) {
cmdlineInputFunc(ch, cliState); // My custom
cmdlineMainLoop(cliState); // command line interpreter
}
}
And I used command line intepreter :) I noticed alt_getchar() when there is no char to read returns 0x11 and 0x13 alternatively.
My problem is solved, thank you very much for support!