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