encoder.c
static int encoder_command(int read) {
    SPI4BUF;
    SPI4BUF = read;
    while(!SPI4STATbits.SPIRBF)  {;}
    SPI4BUF;
    SPI4BUF = 5;
    while(!SPI4STATbits.SPIRBF)  {;}
    return SPI4BUF;
}
// read and/or rest encoder chip
read and/or rest encoder chip
read and / or rest encoder chip
static int encoder_command(int read) {
    SPI4BUF;
    SPI4BUF = read;
    while(!SPI4STATbits.SPIRBF)  {;}
    SPI4BUF;
    SPI4BUF = 5;
    while(!SPI4STATbits.SPIRBF)  {;}
    return SPI4BUF;
}
static int encoder_command ( int read ) { SPI4BUF ; SPI4BUF = read ; while ( ! SPI4STATbits . SPIRBF ) { ; } SPI4BUF ; SPI4BUF = 5 ; while ( ! SPI4STATbits . SPIRBF ) { ; } return SPI4BUF ; }
read and/or rest encoder chip
read and / or rest encoder chip