X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/blobdiff_plain/a65c08fc834ac57cb4aab5470ca144d13076a2bd..d033bdb303afa32f5a022f817bb9af238da803ce:/flash-ota.c diff --git a/flash-ota.c b/flash-ota.c index 31e2ab5..5efd027 100644 --- a/flash-ota.c +++ b/flash-ota.c @@ -228,7 +228,7 @@ int send_hm_message(struct ota_dev *dev, struct recv_data *rdata, uint8_t *msg) } } errno = 0; - pfd = hmcfgusb_poll(dev->hmcfgusb, 1); + pfd = hmcfgusb_poll(dev->hmcfgusb, 1000); if ((pfd < 0) && errno) { if (errno != ETIMEDOUT) { perror("\n\nhmcfgusb_poll"); @@ -263,7 +263,7 @@ int send_hm_message(struct ota_dev *dev, struct recv_data *rdata, uint8_t *msg) int pfd; do { errno = 0; - pfd = culfw_poll(dev->culfw, 1); + pfd = culfw_poll(dev->culfw, 200); if ((pfd < 0) && errno) { if (errno != ETIMEDOUT) { perror("\n\nculfw_poll"); @@ -305,7 +305,7 @@ static int switch_speed(struct ota_dev *dev, struct recv_data *rdata, uint8_t sp while (1) { errno = 0; - pfd = hmcfgusb_poll(dev->hmcfgusb, 1); + pfd = hmcfgusb_poll(dev->hmcfgusb, 1000); if ((pfd < 0) && errno) { if (errno != ETIMEDOUT) { perror("\n\nhmcfgusb_poll"); @@ -420,7 +420,7 @@ int main(int argc, char **argv) culfw_send(dev.culfw, "V\r\n", 3); errno = 0; - pfd = culfw_poll(dev.culfw, 1); + pfd = culfw_poll(dev.culfw, 1000); if ((pfd < 0) && errno) { if (errno != ETIMEDOUT) { perror("\n\nhmcfgusb_poll"); @@ -435,11 +435,9 @@ int main(int argc, char **argv) (rdata.version >> 8) & 0xff, rdata.version & 0xff); - if (rdata.version < 0x0139) { - fprintf(stderr, "\nThis version does _not_ support firmware upgrade mode!\n"); + if (rdata.version < 0x013a) { + fprintf(stderr, "\nThis version does _not_ support firmware upgrade mode, you need at least 1.58!\n"); exit(EXIT_FAILURE); - } else if (rdata.version < 0x0140) { - printf("\n*** This version probably not supports firmware upgrade mode! ***\n\n"); } } else { hmcfgusb_set_debug(debug); @@ -486,7 +484,7 @@ int main(int argc, char **argv) while (1) { errno = 0; - pfd = hmcfgusb_poll(dev.hmcfgusb, 1); + pfd = hmcfgusb_poll(dev.hmcfgusb, 1000); if ((pfd < 0) && errno) { if (errno != ETIMEDOUT) { perror("\n\nhmcfgusb_poll"); @@ -516,11 +514,11 @@ int main(int argc, char **argv) errno = 0; switch (dev.type) { case DEVICE_TYPE_CULFW: - pfd = culfw_poll(dev.culfw, 1); + pfd = culfw_poll(dev.culfw, 1000); break; case DEVICE_TYPE_HMCFGUSB: default: - pfd = hmcfgusb_poll(dev.hmcfgusb, 1); + pfd = hmcfgusb_poll(dev.hmcfgusb, 1000); break; } @@ -713,11 +711,11 @@ int main(int argc, char **argv) errno = 0; switch(dev.type) { case DEVICE_TYPE_CULFW: - pfd = culfw_poll(dev.culfw, 1); + pfd = culfw_poll(dev.culfw, 1000); break; case DEVICE_TYPE_HMCFGUSB: default: - pfd = hmcfgusb_poll(dev.hmcfgusb, 1); + pfd = hmcfgusb_poll(dev.hmcfgusb, 1000); break; } if ((pfd < 0) && errno) {