Multi-tasking...

I want to read a character input from the keyboard so I used..

getchar();

The problem is, I want to be able to continue on with my program if user does not enter any character from the keyboard. The solution I have in mind is to do multi-tasking, but I am not sure if 8051 supports it. Also, I know that in C++, there is a function called..

peek();

This will return out of its function if a key is not pressed. So I want to know if C has a function similar to this...

thanks
Tommy

Parents
  • Maybe RTX51 Tiny is the answer of your question.

    However, I found it too restrictive on calling same function from several tasks (even if the function is reentrant).

    Maybe RTX51 is the solution, but I wrote a simple scheduler which runs the registered functions with the given periods. This way I can check the keyboard for hits and debounce the keys.

    But, I do not know if this is the proper way.

Reply
  • Maybe RTX51 Tiny is the answer of your question.

    However, I found it too restrictive on calling same function from several tasks (even if the function is reentrant).

    Maybe RTX51 is the solution, but I wrote a simple scheduler which runs the registered functions with the given periods. This way I can check the keyboard for hits and debounce the keys.

    But, I do not know if this is the proper way.

Children
More questions in this forum