Browse Source

global: improve user storage security

sound_level_enforcer
King Kévin 2 years ago
parent
commit
4ddf1562fc
  1. 6
      global.c
  2. 4
      global.h

6
global.c

@ -13,9 +13,9 @@ @@ -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) @@ -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

4
global.h

@ -13,9 +13,9 @@ @@ -13,9 +13,9 @@
*
*/
/** global definitions and methods (API)
* @file global.h
* @file
* @author King Kévin <kingkevin@cuvoodoo.info>
* @date 2016-2019
* @date 2016-2020
*/
#pragma once

Loading…
Cancel
Save