Changeset 1542 for trunk/ft2232_spi.c


Ignore:
Timestamp:
Jun 14, 2012 3:08:33 PM (11 months ago)
Author:
stefanct
Message:

Fix setting the divisor in ft2232_spi.

The patch that should have improved the clock divisor setting in r1537 made
it much worse: the divisor used was from an uninitialized buffer.

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@…>
Acked-by: Stefan Tauner <stefan.tauner@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ft2232_spi.c

    r1537 r1542  
    326326        msg_pdbg("Set clock divisor\n"); 
    327327        buf[0] = 0x86;          /* command "set divisor" */ 
     328        buf[1] = (divisor / 2 - 1) & 0xff; 
     329        buf[2] = ((divisor / 2 - 1) >> 8) & 0xff; 
    328330        if (send_buf(ftdic, buf, 3)) { 
    329331                ret = -6; 
    330332                goto ftdi_err; 
    331333        } 
    332         buf[1] = (divisor / 2 - 1) & 0xff; 
    333         buf[2] = ((divisor / 2 - 1) >> 8) & 0xff; 
    334334 
    335335        msg_pdbg("MPSSE clock: %f MHz, divisor: %u, SPI clock: %f MHz\n", 
Note: See TracChangeset for help on using the changeset viewer.