File tree Expand file tree Collapse file tree 1 file changed +5
-27
lines changed
libraries/SAMD_BootloaderUpdater/examples/UpdateBootloader Expand file tree Collapse file tree 1 file changed +5
-27
lines changed Original file line number Diff line number Diff line change 55
66 If it is not, it prompts you to update it.
77
8- NOTE: please make sure the line ending setting in the Serial Monitor is set to "Both NL & CR"
9-
108 Circuit:
119 - MKR Vidor 4000
1210
@@ -41,10 +39,12 @@ retry:
4139 Serial.println (" Would you like to proceed with updating it? (y/N)" );
4240 Serial.println ();
4341
44- String input = readLine ();
45- input.toLowerCase ();
4642
47- if (input != " y" ) {
43+ while (Serial.available () == 0 ) {
44+ delay (100 );
45+ }
46+ char in = Serial.read ();
47+ if (in != ' y' && in != ' Y' ) {
4848 Serial.println (" That's all folks!" );
4949 while (1 );
5050 }
@@ -86,25 +86,3 @@ void loop() {
8686 delay (100 );
8787}
8888
89- String readLine () {
90- String line;
91-
92- while (1 ) {
93- if (Serial.available ()) {
94- char c = Serial.read ();
95-
96- if (c == ' \r ' ) {
97- // ignore
98- } else if (c == ' \n ' ) {
99- break ;
100- }
101-
102- line += c;
103- }
104- }
105-
106- line.trim ();
107-
108- return line;
109- }
110-
You can’t perform that action at this time.
0 commit comments