all: Rename variable readed to sent
This commit is contained in:
1 parent
ed4bdab6e7
commit
62fa041f86
3 files changed
+29
-29
No files matched your search
+17
-17
@@ -138,7 +138,7 @@ struct xloader_msg {
|
||||
struct xloader_msg xloader_msg_create(uint32_t type, struct image * image) {
|
||||
|
||||
struct xloader_msg msg;
|
||||
uint32_t need, readed;
|
||||
uint32_t need, sent;
|
||||
int ret;
|
||||
uint8_t buffer[1024];
|
||||
|
||||
@@ -149,16 +149,16 @@ struct xloader_msg xloader_msg_create(uint32_t type, struct image * image) {
|
||||
if ( image ) {
|
||||
msg.size = image->size;
|
||||
image_seek(image, 0);
|
||||
readed = 0;
|
||||
while ( readed < image->size ) {
|
||||
need = image->size - readed;
|
||||
sent = 0;
|
||||
while ( sent < image->size ) {
|
||||
need = image->size - sent;
|
||||
if ( need > sizeof(buffer) )
|
||||
need = sizeof(buffer);
|
||||
ret = image_read(image, buffer, need);
|
||||
if ( ret == 0 )
|
||||
break;
|
||||
msg.crc1 = crc32(buffer, ret, msg.crc1);
|
||||
readed += ret;
|
||||
sent += ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ static int read_asic(libusb_device_handle * udev, uint8_t * asic_buffer, int siz
|
||||
static int send_2nd(libusb_device_handle * udev, struct image * image) {
|
||||
|
||||
uint8_t buffer[1024];
|
||||
uint32_t need, readed;
|
||||
uint32_t need, sent;
|
||||
int ret, transferred;
|
||||
|
||||
printf("Sending OMAP peripheral boot message...\n");
|
||||
@@ -206,9 +206,9 @@ static int send_2nd(libusb_device_handle * udev, struct image * image) {
|
||||
printf("Sending 2nd X-Loader image...\n");
|
||||
printf_progressbar(0, image->size);
|
||||
image_seek(image, 0);
|
||||
readed = 0;
|
||||
while ( readed < image->size ) {
|
||||
need = image->size - readed;
|
||||
sent = 0;
|
||||
while ( sent < image->size ) {
|
||||
need = image->size - sent;
|
||||
if ( need > sizeof(buffer) )
|
||||
need = sizeof(buffer);
|
||||
ret = image_read(image, buffer, need);
|
||||
@@ -218,8 +218,8 @@ static int send_2nd(libusb_device_handle * udev, struct image * image) {
|
||||
PRINTF_ERROR_RETURN("Sending 2nd X-Loader image failed", -1);
|
||||
if ( ret != transferred )
|
||||
PRINTF_ERROR_RETURN("Sending 2nd X-Loader image failed (incomplete bulk transfer)", -1);
|
||||
readed += transferred;
|
||||
printf_progressbar(readed, image->size);
|
||||
sent += transferred;
|
||||
printf_progressbar(sent, image->size);
|
||||
}
|
||||
|
||||
SLEEP(50000);
|
||||
@@ -231,7 +231,7 @@ static int send_secondary(libusb_device_handle * udev, struct image * image) {
|
||||
|
||||
struct xloader_msg init_msg;
|
||||
uint8_t buffer[1024];
|
||||
uint32_t need, readed;
|
||||
uint32_t need, sent;
|
||||
int ret, transferred;
|
||||
|
||||
init_msg = xloader_msg_create(XLOADER_MSG_TYPE_SEND, image);
|
||||
@@ -250,9 +250,9 @@ static int send_secondary(libusb_device_handle * udev, struct image * image) {
|
||||
printf("Sending Secondary image...\n");
|
||||
printf_progressbar(0, image->size);
|
||||
image_seek(image, 0);
|
||||
readed = 0;
|
||||
while ( readed < image->size ) {
|
||||
need = image->size - readed;
|
||||
sent = 0;
|
||||
while ( sent < image->size ) {
|
||||
need = image->size - sent;
|
||||
if ( need > sizeof(buffer) )
|
||||
need = sizeof(buffer);
|
||||
ret = image_read(image, buffer, need);
|
||||
@@ -262,8 +262,8 @@ static int send_secondary(libusb_device_handle * udev, struct image * image) {
|
||||
PRINTF_ERROR_RETURN("Sending Secondary image failed", -1);
|
||||
if ( ret != transferred )
|
||||
PRINTF_ERROR_RETURN("Sending Secondary image failed (incomplete bulk transfer)", -1);
|
||||
readed += transferred;
|
||||
printf_progressbar(readed, image->size);
|
||||
sent += transferred;
|
||||
printf_progressbar(sent, image->size);
|
||||
}
|
||||
|
||||
printf("Waiting for X-Loader response...\n");
|
||||
|
||||
+6
-6
@@ -166,7 +166,7 @@ int disk_dump_dev(int fd, const char * file) {
|
||||
int ret;
|
||||
char * path;
|
||||
uint64_t blksize;
|
||||
size_t need, readed;
|
||||
size_t need, sent;
|
||||
ssize_t size;
|
||||
struct statvfs buf;
|
||||
|
||||
@@ -226,11 +226,11 @@ int disk_dump_dev(int fd, const char * file) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
readed = 0;
|
||||
sent = 0;
|
||||
printf_progressbar(0, blksize);
|
||||
|
||||
while ( readed < blksize ) {
|
||||
need = blksize - readed;
|
||||
while ( sent < blksize ) {
|
||||
need = blksize - sent;
|
||||
if ( need > sizeof(global_buf) )
|
||||
need = sizeof(global_buf);
|
||||
size = read(fd, global_buf, need);
|
||||
@@ -241,8 +241,8 @@ int disk_dump_dev(int fd, const char * file) {
|
||||
close(fd2);
|
||||
return -1;
|
||||
}
|
||||
readed += size;
|
||||
printf_progressbar(readed, blksize);
|
||||
sent += size;
|
||||
printf_progressbar(sent, blksize);
|
||||
}
|
||||
|
||||
close(fd2);
|
||||
|
||||
+6
-6
@@ -256,7 +256,7 @@ static int nolo_send_image(struct usb_device_info * dev, struct image * image, i
|
||||
uint16_t hash;
|
||||
uint32_t size;
|
||||
uint32_t need;
|
||||
uint32_t readed;
|
||||
uint32_t sent;
|
||||
int request;
|
||||
int ret;
|
||||
int transferred;
|
||||
@@ -384,9 +384,9 @@ static int nolo_send_image(struct usb_device_info * dev, struct image * image, i
|
||||
printf("Sending image...\n");
|
||||
printf_progressbar(0, image->size);
|
||||
image_seek(image, 0);
|
||||
readed = 0;
|
||||
while ( readed < image->size ) {
|
||||
need = image->size - readed;
|
||||
sent = 0;
|
||||
while ( sent < image->size ) {
|
||||
need = image->size - sent;
|
||||
if ( need > sizeof(buf) )
|
||||
need = sizeof(buf);
|
||||
ret = image_read(image, buf, need);
|
||||
@@ -402,8 +402,8 @@ static int nolo_send_image(struct usb_device_info * dev, struct image * image, i
|
||||
NOLO_ERROR_RETURN("Sending image was incomplete!", -1);
|
||||
}
|
||||
}
|
||||
readed += transferred;
|
||||
printf_progressbar(readed, image->size);
|
||||
sent += ret;
|
||||
printf_progressbar(sent, image->size);
|
||||
}
|
||||
|
||||
if ( flash ) {
|
||||
|
||||
Reference in new issue
Block a user