arduino/Arduino — pull request #1635 by rock-fish (2013-10-22 02:44:39+00:00)
Title: Fixed shiftIn not reading the first input pin

Originally, using a shift register that did not require an initial
shift to read the first input, shiftIn would pulse the clock pin before
reading from the data (output on the shift register) pin. This would
result in the value from first input pin being replaced by the value
from the second input pin. This has been fixed by reading from the data
pin before shifting, and can be adapted for use with shift registers
such as the CD4021B that require a clock pulse for the first input
to be shifted into the output register by simple pulsing the clock
before calling shiftIn