Merge pull request #206 from gsomlo/gls-tftp-spinner
BIOS: TFTP: ASCII spinner progress indicator (cosmetic)
This commit is contained in:
commit
f49d0fe6c9
|
@ -115,6 +115,7 @@ int tftp_get(uint32_t ip, uint16_t server_port, const char *filename,
|
||||||
int tries;
|
int tries;
|
||||||
int i;
|
int i;
|
||||||
int length_before;
|
int length_before;
|
||||||
|
int spin = 0;
|
||||||
|
|
||||||
if(!microudp_arp_resolve(ip))
|
if(!microudp_arp_resolve(ip))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -148,6 +149,10 @@ int tftp_get(uint32_t ip, uint16_t server_port, const char *filename,
|
||||||
if(length_before != total_length) {
|
if(length_before != total_length) {
|
||||||
i = 12000000;
|
i = 12000000;
|
||||||
length_before = total_length;
|
length_before = total_length;
|
||||||
|
if ((total_length & 0x7fff) == 0) { // every 32K
|
||||||
|
putchar("|/-\\"[spin++ % 4]);
|
||||||
|
putchar('\b');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(i-- == 0) {
|
if(i-- == 0) {
|
||||||
microudp_set_callback(NULL);
|
microudp_set_callback(NULL);
|
||||||
|
|
Loading…
Reference in New Issue