- # Bytes 2/3/4: Master sends address of the sector to erase.
- # Note: Assumes SPI data is 8 bits wide (it is for MX25Lxx05D).
- # TODO: LSB-first of MSB-first?
- self.addr <<= 8
- self.addr |= mosi
- self.putx([0, ['Address byte %d: 0x%02x' % (self.cmdstate - 1,
- miso)]]) # TODO: Count from 0 or 1?
+ # Bytes 2/3/4: Master sends sectror address (24bits, MSB-first).
+ self.addr |= (mosi << ((4 - self.cmdstate) * 8))
+ # self.putx([0, ['Sector address, byte %d: 0x%02x' % \
+ # (4 - self.cmdstate, mosi)]])