merging in the code updates to the SPI master code done in commit b834fcf78a. TW#15670, Closes #1027
b834fcf78a