It was using the wrong field in the hardware table to change the pin mode for the CS pin. (was using SCK pins value)main
{ | { | ||||
for (unsigned int i = 0; i < sizeof(hardware().cs_pin); i++) { | for (unsigned int i = 0; i < sizeof(hardware().cs_pin); i++) { | ||||
if (pin == hardware().cs_pin[i]) { | if (pin == hardware().cs_pin[i]) { | ||||
*(portConfigRegister(pin)) = hardware().sck_mux[i]; | |||||
*(portConfigRegister(pin)) = hardware().cs_mux[i]; | |||||
hardware().pcs0_select_input_register = hardware().pcs0_select_val[i]; | |||||
return 1; | return 1; | ||||
} | } | ||||
} | } |