BIOS: TFTP: ASCII spinner progress indicator (cosmetic)

This commit is contained in:
Gabriel L. Somlo 2019-06-27 10:31:33 -04:00
parent d5177d72ac
commit 5a42dbf333
1 changed files with 5 additions and 0 deletions

View File

@ -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);