File tree 1 file changed +5
-27
lines changed
libraries/SAMD_BootloaderUpdater/examples/UpdateBootloader
1 file changed +5
-27
lines changed Original file line number Diff line number Diff line change 5
5
6
6
If it is not, it prompts you to update it.
7
7
8
- NOTE: please make sure the line ending setting in the Serial Monitor is set to "Both NL & CR"
9
-
10
8
Circuit:
11
9
- MKR Vidor 4000
12
10
@@ -41,10 +39,12 @@ retry:
41
39
Serial.println (" Would you like to proceed with updating it? (y/N)" );
42
40
Serial.println ();
43
41
44
- String input = readLine ();
45
- input.toLowerCase ();
46
42
47
- if (input != " y" ) {
43
+ while (Serial.available () == 0 ) {
44
+ delay (100 );
45
+ }
46
+ char in = Serial.read ();
47
+ if (in != ' y' && in != ' Y' ) {
48
48
Serial.println (" That's all folks!" );
49
49
while (1 );
50
50
}
@@ -86,25 +86,3 @@ void loop() {
86
86
delay (100 );
87
87
}
88
88
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