11-11-2024 12:18 AM
I'm using case structure and i made three cases read, write , and none to do all these functions from stm32 via uart.
but when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.
11-11-2024 12:48 AM
Hi Anup,
@AnupSW13 wrote:
when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.
I guess there is a problem in your code.
As you forgot to attach code you need to debug on your own…
11-11-2024 01:10 AM
Also know that matches are case sensitive unless you configure it for "case insensitive match".
Why not place an indicator on the wire going to the selector and make sure it contains what you think it does. (e.g. switch it to \-codes display)
11-11-2024 07:12 AM
@AnupSW13 wrote:
I'm using case structure and i made three cases read, write , and none to do all these functions from stm32 via uart.
but when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.
What debugging steps have you used? If only the default case executes (and we can't verify that this is really happening until we can look at your code) then the case selector input has not matched any other case. Anything is possible; typographical errors, a hidden tunnel under the selector, race conditions, etc...
11-11-2024 07:33 AM
@AnupSW13 wrote:
I'm using case structure and i made three cases read, write , and none to do all these functions from stm32 via uart.
but when i give input read or write it still runs the default case only.
what could be the issue i used trim whitespace and string indicator to check the input. but still it only runs the default case.
If functions is a type def'd enum (it sounds like it should), you wouldn't have this issue.
The case structure would only allow the read, write and none, and the default case can and should be removed.