Non-intrusif scanf()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-12 8:53 AM
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
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-12 9:24 AM
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?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-12 9:24 AM
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?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-12 10:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-03 4:21 AM
Sorry for the delay ,
https://community.st.com/s/question/0D53W00000e2emJ/rx-interrupt-with-runtimeio
