Reversed bit order of SPIC and fixed Logic Analyzer CH2

This commit is contained in:
EspoTek 2017-12-01 15:34:03 +11:00
parent c93cf854da
commit daa1d3dab2
1 changed files with 1 additions and 2 deletions

View File

@ -38,14 +38,13 @@ void tiny_spi_setup(void){
PR.PRPC &= 0b11110111; PR.PRPC &= 0b11110111;
//SPI enable //SPI enable
SPIC.CTRL = SPI_ENABLE_bm; //Slave mode
SPIC.INTCTRL = SPI_INTLVL_OFF_gc; SPIC.INTCTRL = SPI_INTLVL_OFF_gc;
//#ifdef VERO //#ifdef VERO
PORTC.PIN5CTRL = PORT_INVEN_bm | PORT_OPC_PULLUP_gc; PORTC.PIN5CTRL = PORT_INVEN_bm | PORT_OPC_PULLUP_gc;
//#else //#else
// PORTC.PIN7CTRL = PORT_INVEN_bm | PORT_OPC_PULLUP_gc; //Pin5 if not swapped // PORTC.PIN7CTRL = PORT_INVEN_bm | PORT_OPC_PULLUP_gc; //Pin5 if not swapped
//#endif //#endif
SPIC.CTRL = SPI_DORD_bm | SPI_ENABLE_bm; //Slave mode
return; return;
} }