Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 8af8154

Browse files
authoredJul 28, 2017
Fixed flush function to clear incoming data (#52)
* Fixed flush function to clear incoming data * Added flush function to remove any character that may be present from previous attempts
1 parent 793b734 commit 8af8154

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed
 

‎cores/arduino/Uart.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ void Uart::end()
8585
void Uart::flush()
8686
{
8787
nrf_uarte_task_trigger(NRF_UARTE0, NRF_UARTE_TASK_STARTTX);
88+
rxBuffer.clear();
8889
}
8990

9091
void Uart::IrqHandler()

‎libraries/BLE/examples/Central/Bonding/enterPasskeyCentral/enterPasskeyCentral.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ void writePasskey(BLEPeripheralPeer& peer) {
114114
int i=0;
115115
int j=0;
116116
Serial.println("Type the 6 digits code you see on the other device");
117+
Serial.flush();
117118
while(i < 6){
118119
j=Serial.available();
119120
for(int k=0; k<j; k++){

‎libraries/BLE/examples/Peripheral/Bonding/enterPasskey/enterPasskey.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ void writePasskey(BLECentral& central) {
7474
int i=0;
7575
int j=0;
7676
Serial.println("Type the 6 digits code you see on the other device");
77+
Serial.flush();
7778
while(i < 6){
7879
j=Serial.available();
7980
for(int k=0; k<j; k++){

0 commit comments

Comments
 (0)
This repository has been archived.