terminal: get this compiling again
cover terminal: get this compiling again
`terminal' has not compiled in 7 years. We should fix it, per this series or something similar, or remove it.
I've been trying to use it locally with a secondary UART on a RISC-V dev board (to no avail, but that's my own problem).
P.S. Let me know if I'm sending too many patches, I realise I already have several outstanding.
Asherah Connor (2):
terminal: correct stdio_dev invocations
terminal: only serial_reinit_all if available
cmd/terminal.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/2 terminal: correct stdio_dev invocations
stdio_dev methods have taken a pointer to themselves since 709ea543 (nearly 7 years ago).
---
cmd/terminal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
cmd/terminal.c +6 -6
@@ -33,8 +33,8 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[])int c;/* read from console and display on serial port */ -if (stdio_devices[0 ]->tstc ()) { - c = stdio_devices[0 ]->getc (); +if (stdio_devices[0 ]->tstc (stdio_devices[0 ])) { + c = stdio_devices[0 ]->getc (stdio_devices[0 ]);if (last_tilde ==1 ) {if (c =='.' ) {putc (c);
@@ -43,7 +43,7 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[]) }else { last_tilde =0 ;/* write the delayed tilde */ - dev->putc ('~' ); + dev->putc (dev,'~' );/* fall-through to print current * character */ }
@@ -53,12 +53,12 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[])puts ("[u-boot]" );putc (c); } - dev->putc (c); + dev->putc (dev, c); }/* read from serial port and display on console */ -if (dev->tstc ()) { - c = dev->getc (); +if (dev->tstc (dev)) { + c = dev->getc (dev);putc (c); } }
Signature · 1 line
2.20.1
PATCH 1/2 terminal: correct stdio_dev invocations
Quoted 9 lines · Asherah Connor
stdio_devmethods have taken a pointer to themselves since709ea543(nearly 7 years ago).Signed-off-by Asherah Connor <[email protected]>---
cmd/terminal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
PATCH 1/2 terminal: correct stdio_dev invocations
In reply to Asherah ConnorQuoted 5 lines · Asherah Connor
stdio_devmethods have taken a pointer to themselves since709ea543(nearly 7 years ago).Signed-off-by Asherah Connor <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210413/d6116723/attachment.sig>
PATCH 2/2 terminal: only serial_reinit_all if available
In reply to Asherah Connorserial_reinit_all() is only available if CONFIG_SERIAL is defined (i.e. !CONFIG_DM_SERIAL).
---
cmd/terminal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
cmd/terminal.c +3 -1
@@ -25,7 +25,9 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[])if (!dev)return -1 ; -serial_reinit_all (); +if (IS_ENABLED (CONFIG_SERIAL )) +serial_reinit_all (); +printf ("Entering terminal mode for port %s\n" , dev->name);puts ("Use '~.' to leave the terminal and get back to u-boot\n" );
Signature · 1 line
2.20.1
PATCH 2/2 terminal: only serial_reinit_all if available
Quoted 10 lines · Asherah Connor
serial_reinit_all()is only available ifCONFIG_SERIALis defined (i.e. !CONFIG_DM_SERIAL).Signed-off-by Asherah Connor <[email protected]>---
cmd/terminal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
PATCH 2/2 terminal: only serial_reinit_all if available
In reply to Asherah ConnorQuoted 5 lines · Asherah Connor
serial_reinit_all()is only available ifCONFIG_SERIALis defined (i.e. !CONFIG_DM_SERIAL).Signed-off-by Asherah Connor <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210413/6b526a76/attachment.sig>