cancel
Showing results for 
Search instead for 
Did you mean: 

Non-intrusif scanf()

Bastien1
Associate III

Hello,

I'm working on the SPC574S-DISP board, I've set up FreeRTOS and I would like to have a way to do a non-intrusive scanf.

I would like the program to keep running and wait for a key to be pressed to access a submenu.

The problem is that with scanf(), the debug gets stuck.

Can you help me?

Thank you very much in advance 

Regards

Bastien

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions

You're going to have to code that yourself, using a character input method that checks if data is available and leaves immediately rather than blocking. When you have data to decode use sscanf() on the string.

If the menu just needs a character, why even use scanf() for that?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

You're going to have to code that yourself, using a character input method that checks if data is available and leaves immediately rather than blocking. When you have data to decode use sscanf() on the string.

If the menu just needs a character, why even use scanf() for that?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Okay thank you for your answer I will try.

I don't want to use scanf() for my menu because it will send me real time values so it will refresh very often. On top of that I want to be able to navigate from menu to other menu

Erwan YVIN
ST Employee