Stefan Reinauer submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, but someone else must approve Tim Wawrzynczak: Looks good to me, approved
em100: Make trace mode output more resilient

When redirecting em100 output to a file, say with | tee <filename>,
we won't see any output from the tool until actual SPI commands are
coming in. This is annoying, as you don't know when the download is
finished, if your workflow is for example as follows:

1. start em100 in trace mode
2. wait for download to em100 to finish
3. power-cycle / turn on the machine

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Change-Id: I36916ab71d3b929deb4d8cfed7b22a2ce90b2672
Reviewed-on: https://review.coreboot.org/c/em100/+/48866
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
---
M em100.c
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/em100.c b/em100.c
index 7a6f910..a8a0708 100644
--- a/em100.c
+++ b/em100.c
@@ -1246,7 +1246,8 @@
printf("terminal");
}

- printf(". Press CTL-C to exit.\n\n");
+ printf(". Press CTRL-C to exit.\n\n");
+ fflush(stdout);

while (!exit_requested && usb_errors < MAX_USB_ERRORS) {
int ret;

To view, visit change 48866. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: em100
Gerrit-Branch: master
Gerrit-Change-Id: I36916ab71d3b929deb4d8cfed7b22a2ce90b2672
Gerrit-Change-Number: 48866
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged