Skip to content

Commit bf138eb

Browse files
committed
Remove isConnected() usage from examples
1 parent ad51f6f commit bf138eb

13 files changed

Lines changed: 15 additions & 15 deletions

File tree

STM32F1/libraries/A_STM32_Examples/examples/General/BlinkNcount/BlinkNcount.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void setup() {
1515
// Initialize virtual COM over USB on Maple Mini
1616
Serial.begin(9600); // BAUD has no effect on USB serial: placeholder for physical UART
1717
// wait for serial monitor to be connected.
18-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
18+
while (!Serial)
1919
{
2020
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2121
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/IntegerInput/IntegerInput.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void setup()
1818
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
1919
Serial.setTimeout(timeoutPeriod); // default is 1 second
2020
// wait for serial monitor to be connected.
21-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
21+
while (!Serial)
2222
{
2323
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2424
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/IntegerInput_FloatOutput/IntegerInput_FloatOutput.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void setup()
1919
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
2020
Serial.setTimeout(timeoutPeriod); // default is 1 second
2121
// wait for serial monitor to be connected.
22-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
22+
while (!Serial)
2323
{
2424
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2525
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/InternalTempSensor/InternalTempSensor.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void setup(void)
3838
pinMode(A_RANDOM_ANALOG_PIN, INPUT_ANALOG);
3939

4040
// wait for serial monitor to be connected.
41-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
41+
while (!Serial)
4242
{
4343
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
4444
delay(100); // fast blink
@@ -48,7 +48,7 @@ void setup(void)
4848
setup_temperature_sensor();
4949

5050
// announce start up
51-
if(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS()))
51+
if(Serial)
5252
Serial.println("Temp mon startup");
5353
}
5454

@@ -69,7 +69,7 @@ void loop(void)
6969
t2 = micros();
7070
vsense = adc_read(ADC1, 16);
7171
t3 = micros();
72-
if(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())) {
72+
if(Serial) {
7373
sprintf(buf,"%04x %08x %04x %08x" , vsense, t3-t2, alogpin, t2-t1);
7474
Serial.println(buf);
7575
}

STM32F1/libraries/A_STM32_Examples/examples/General/PrimeNos/PrimeNos.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void setup()
2929
pinMode(33, OUTPUT);
3030
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
3131
// wait for serial monitor to be connected.
32-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
32+
while (!Serial)
3333
{
3434
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
3535
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/PrimeNos2/PrimeNos2.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void setup() {
1818
pinMode(33, OUTPUT);
1919
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
2020
// wait for serial monitor to be connected.
21-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
21+
while (!Serial)
2222
{
2323
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2424
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/PrimeNos3/PrimeNos3.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void setup() {
1818
pinMode(33, OUTPUT);
1919
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
2020
// wait for serial monitor to be connected.
21-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
21+
while (!Serial)
2222
{
2323
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2424
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/Print_Binary/Print_Binary.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void setup()
1515
pinMode(33, OUTPUT);
1616
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
1717
// wait for serial monitor to be connected.
18-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
18+
while (!Serial)
1919
{
2020
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2121
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/Print_Float/Print_Float.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void setup() // run once, when the sketch starts
1717
pinMode(33, OUTPUT);
1818
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
1919
// wait for serial monitor to be connected.
20-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
20+
while (!Serial)
2121
{
2222
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2323
delay(100); // fast blink

STM32F1/libraries/A_STM32_Examples/examples/General/Print_HEX/Print_HEX.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void setup() // run once, when the sketch starts
1616
pinMode(33, OUTPUT);
1717
Serial.begin(BAUD); // BAUD has no effect on USB serial: placeholder for physical UART
1818
// wait for serial monitor to be connected.
19-
while (!(Serial.isConnected() && (Serial.getDTR() || Serial.getRTS())))
19+
while (!Serial)
2020
{
2121
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
2222
delay(100); // fast blink

0 commit comments

Comments
 (0)