SOLVED: read from stdin non-block

Hello,

I’m not able to read from stdin non-blocking.

If I use:
length = fread(buffer, 1, 10, stdin);
My code hangs until buffer is full.

If I use:
serEopen(115200);
serEdatabits(PARAM_8BIT);
serEparity(PARAM_NOPARITY | PARAM_1STOP);
serXrdFlush(SER_PORT_E);

length = serXread(SER_PORT_E, buffer, 10, 0);

printf stops working… I use printf many times in my code.

Can somebody help me? Thanks in advance.
Martin

Hello,

I made a mistake. The second way is working if you set the debug serial output to PortE

#define STDIO_DEBUG_SERIAL SEDR

So I don’t need help anymore.

Martin