adapted for SPI changes in 1.8.1+