Kindle Detection Bug in Calibre

The Kindle has been very tricky to get working in Calibre. However, it is finally working correctly (at least it should be).

The latest issue with the Kindle driver was in the usbms core. The main memory location was never being set. On Windows the driver loops over all attached drives and matches the drive to the internal or card memory. At the end of the loop before it starts over there is a check to see if the main and card memory have been matched. The idea being if both have been found there is no reason to continue looping over the drives. The check would then quit the loop. The issue was this check. It would only quit the loop when the card memory was found (the loop would still quit once all the drives had been checked). With the Kindle the card memory is reported before the main memory so the loop would always quit before it find the main memory. This isn’t the case with the Cybook which is why there wasn’t an issue even though it’s the same code path.