Skip to content

Commit 16d8e79

Browse files
lynxisgraysky2
authored andcommitted
bossa: add patch to fix flash failures on serial
bossa only waited 1ms for the serial device instead calling tcdrain(). Without this patch bossa is failing to flash a ATSAM3S4 8/10 times. Patch has been submitted as PR#150 upstream. shumatech/BOSSA#150 Signed-off-by: Alexander Couzens <[email protected]>
1 parent ea9b827 commit 16d8e79

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 0fd3078b4863002e5d384d7e453d668841414abe Mon Sep 17 00:00:00 2001
2+
From: Kay Sievers <[email protected]>
3+
Date: Wed, 13 Jan 2021 01:34:08 +0100
4+
Subject: [PATCH] PosixSerialPort: Call tcdrain() to write serial data
5+
GithubPR: 150
6+
7+
---
8+
src/PosixSerialPort.cpp | 5 +----
9+
1 file changed, 1 insertion(+), 4 deletions(-)
10+
11+
--- a/src/PosixSerialPort.cpp
12+
+++ b/src/PosixSerialPort.cpp
13+
@@ -290,10 +290,7 @@ PosixSerialPort::put(int c)
14+
void
15+
PosixSerialPort::flush()
16+
{
17+
- // There isn't a reliable way to flush on a file descriptor
18+
- // so we just wait it out. One millisecond is the USB poll
19+
- // interval so that should cover it.
20+
- usleep(1000);
21+
+ tcdrain(_devfd);
22+
}
23+
24+
bool

0 commit comments

Comments
 (0)