Skip to content

Commit

Permalink
fix false switching job_switched
Browse files Browse the repository at this point in the history
anomal results reads due SPI error
  • Loading branch information
alpet83 committed Oct 4, 2013
1 parent ee76be0 commit b78818b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libbitfury.c
Expand Up @@ -561,7 +561,11 @@ void libbitfury_sendHashData(struct thr_info *thr, struct bitfury_device *bf, in
memcpy(newbuf, spi_getrxbuf() + 4 + chip, 17*4);
tm_i2c_clear_oe(slot);

d->job_switched = (newbuf[16] != oldbuf[16]);
if ( 0 == newbuf[16] || 0 == !newbuf[16] )
d->job_switched = ( newbuf[16] != oldbuf[16] );
else
applog(LOG_WARNING, "Unexpected value in newbuf[16] == 0x%08x", newbuf[16]);


d->old_num = 0;
d->future_num = 0;
Expand Down

0 comments on commit b78818b

Please sign in to comment.