From: Gabriel L. Somlo Date: Thu, 27 Jun 2019 14:31:33 +0000 (-0400) Subject: BIOS: TFTP: ASCII spinner progress indicator (cosmetic) X-Git-Tag: 24jan2021_ls180~1142^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a42dbf333f3624d79a23658a88f226ccf6128c6;p=litex.git BIOS: TFTP: ASCII spinner progress indicator (cosmetic) --- diff --git a/litex/soc/software/libnet/tftp.c b/litex/soc/software/libnet/tftp.c index 10e31e55..65885de9 100644 --- a/litex/soc/software/libnet/tftp.c +++ b/litex/soc/software/libnet/tftp.c @@ -115,6 +115,7 @@ int tftp_get(uint32_t ip, uint16_t server_port, const char *filename, int tries; int i; int length_before; + int spin = 0; if(!microudp_arp_resolve(ip)) return -1; @@ -148,6 +149,10 @@ int tftp_get(uint32_t ip, uint16_t server_port, const char *filename, if(length_before != total_length) { i = 12000000; length_before = total_length; + if ((total_length & 0x7fff) == 0) { // every 32K + putchar("|/-\\"[spin++ % 4]); + putchar('\b'); + } } if(i-- == 0) { microudp_set_callback(NULL);