I changed all the low level code first and had no problems (also watched irq lines and spi / i2c traffic using a scope). The problems come from the change in sensors.c alone.