1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 04:54:26 +00:00

usbutils cps correct time measurement

This commit is contained in:
Kano 2013-06-26 01:12:01 +10:00
parent fc89f170a3
commit 1f4b99d0e9

View File

@ -2320,7 +2320,7 @@ int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pro
cgtime(&now); cgtime(&now);
need = (double)(usbdev->last_write_siz) / need = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) - (double)(usbdev->cps) -
tdiff(&(usbdev->last_write_tv), &now); tdiff(&now, &(usbdev->last_write_tv));
// Simple error condition check/avoidance '< 1.0' // Simple error condition check/avoidance '< 1.0'
if (need > 0.0 && need < 1.0) { if (need > 0.0 && need < 1.0) {
@ -2429,7 +2429,7 @@ int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pro
cgtime(&now); cgtime(&now);
need = (double)(usbdev->last_write_siz) / need = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) - (double)(usbdev->cps) -
tdiff(&(usbdev->last_write_tv), &now); tdiff(&now, &(usbdev->last_write_tv));
// Simple error condition check/avoidance '< 1.0' // Simple error condition check/avoidance '< 1.0'
if (need > 0.0 && need < 1.0) { if (need > 0.0 && need < 1.0) {
@ -2575,7 +2575,7 @@ int _usb_write(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pr
cgtime(&now); cgtime(&now);
need = (double)(usbdev->last_write_siz) / need = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) - (double)(usbdev->cps) -
tdiff(&(usbdev->last_write_tv), &now); tdiff(&now, &(usbdev->last_write_tv));
// Simple error condition check/avoidance '< 1.0' // Simple error condition check/avoidance '< 1.0'
if (need > 0.0 && need < 1.0) { if (need > 0.0 && need < 1.0) {
@ -2672,7 +2672,7 @@ int __usb_transfer(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bReques
cgtime(&now); cgtime(&now);
need = (double)(usbdev->last_write_siz) / need = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) - (double)(usbdev->cps) -
tdiff(&(usbdev->last_write_tv), &now); tdiff(&now, &(usbdev->last_write_tv));
// Simple error condition check/avoidance '< 1.0' // Simple error condition check/avoidance '< 1.0'
if (need > 0.0 && need < 1.0) { if (need > 0.0 && need < 1.0) {
@ -2749,7 +2749,7 @@ int _usb_transfer_read(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRe
cgtime(&now); cgtime(&now);
need = (double)(usbdev->last_write_siz) / need = (double)(usbdev->last_write_siz) /
(double)(usbdev->cps) - (double)(usbdev->cps) -
tdiff(&(usbdev->last_write_tv), &now); tdiff(&now, &(usbdev->last_write_tv));
// Simple error condition check/avoidance '< 1.0' // Simple error condition check/avoidance '< 1.0'
if (need > 0.0 && need < 1.0) { if (need > 0.0 && need < 1.0) {