global: improve user storage security
This commit is contained in:
parent
7005889f01
commit
4ddf1562fc
6
global.c
6
global.c
|
@ -13,9 +13,9 @@
|
|||
*
|
||||
*/
|
||||
/** global definitions and methods (code)
|
||||
* @file global.c
|
||||
* @file
|
||||
* @author King Kévin <kingkevin@cuvoodoo.info>
|
||||
* @date 2016-2019
|
||||
* @date 2016-2020
|
||||
*/
|
||||
/* standard libraries */
|
||||
#include <stdint.h> // standard integer types
|
||||
|
@ -160,7 +160,7 @@ void sys_tick_handler(void)
|
|||
|
||||
char user_input_get(void)
|
||||
{
|
||||
while (!user_input_available) { // wait for user input
|
||||
while (0 == user_input_used) { // wait for user input to be available (don't trust user_input_available since it user modifiable)
|
||||
__WFI(); // go to sleep
|
||||
}
|
||||
volatile char to_return = user_input_buffer[user_input_i]; // get the next available character
|
||||
|
|
Loading…
Reference in New Issue