Skip to content

Commit fde823a

Browse files
committed
remove the force Serial connected when debug is eanbled.
1 parent 8a1dff3 commit fde823a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cores/nRF5/main.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,13 @@ static void loop_task(void* arg)
4646

4747
#if CFG_DEBUG
4848
// If Serial is not begin(), call it to avoid hard fault
49-
Serial.begin(115200);
50-
51-
// Wait for Serial connection in debug mode
52-
while ( !Serial ) yield();
53-
54-
dbgPrintVersion();
49+
if(!Serial) Serial.begin(115200);
5550
#endif
5651

5752
setup();
5853

5954
#if CFG_DEBUG
55+
dbgPrintVersion();
6056
Bluefruit_printInfo();
6157
#endif
6258

libraries/Bluefruit52Lib/examples/Peripheral/bleuart/bleuart.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ BLEBas blebas; // battery
2424
void setup()
2525
{
2626
Serial.begin(115200);
27-
// while ( !Serial ) delay(10); // for nrf52840 with native usb
27+
28+
#if CFG_DEBUG
29+
// Blocking wait for connection when debug mode is enabled via IDE
30+
while ( !Serial ) yield();
31+
#endif
2832

2933
Serial.println("Bluefruit52 BLEUART Example");
3034
Serial.println("---------------------------\n");

0 commit comments

Comments
 (0)