School project.
Dependencies: Timezone NTPClient BSP_DISCO_F746NG Grove_temperature
Diff: setup_functions.h
- Revision:
- 10:137cf2c92871
- Parent:
- 9:fd1f07a4a0ff
- Child:
- 14:3ac7c08dbc52
--- a/setup_functions.h Thu Jan 14 14:07:01 2021 +0000 +++ b/setup_functions.h Fri Jan 15 09:27:26 2021 +0000 @@ -1,12 +1,10 @@ /** -@file setup_functions.h -@brief Contains functions used for initial setup of the unit, specifically to set the building and room where unit installation is planned. - -@author Tu Tri Huynh -@date 1/13/2021 +@file setup_functions.h +@author Tu Tri Huynh +@date January 13, 2021 +@brief Functions used for initial setup of the unit, specifically to set the building and room where unit installation is planned. */ - /** Declaration of the function (prototype) to allow other functions to call it @date 1/13/2021 @@ -28,9 +26,15 @@ } else { + /// This will empty the buffer and will avoid already inputted data to be used in scanf etc. + int c; + do { + c = getchar(); + } while (c != EOF && c != '\n'); + setup_set_room_and_building(); } - /* + /** printf("setup_confirm function end\n"); */ } @@ -56,9 +60,8 @@ void setup_set_room_and_building() { char temp; - /** 1/14/2021 - When using %s, string will be terminated when white space i found. + When using %s, string will be terminated when white space is found. Therefore, set it to read white spaces with %[^\n] Also, changed wording to reduce "please" sentences.*/ /**