Home > other > About the stm32 serial port interrupt and redirect the scanf function
About the stm32 serial port interrupt and redirect the scanf function
Time:09-25
Like wildfire routines at the beginning, I use a switch statement and getchar for keyboard input characters to do related execution, want to use a serial port interrupt at the same time, the result found getchar not too good, need to enter only occasional success once many times, I see overweight directional function after feel because redirection and serial port interrupts were used to setting rxne sign or not to as a condition of judgment, so is it because the cause of the conflict? And I see the punctual atomic routines directly inside, there is no to redirect the scanf asked some people say that SCM rarely use the scanf, Please god help me ~ ~
CodePudding user response:
I also encountered this problem, the whole for a long time, I also feel is for this reason, but don't have to redirect the scanf, so you can try off interrupt