Demo entry 6635511

Scia

   

Submitted by anonymous on Aug 17, 2017 at 19:13
Language: C. Code size: 564 Bytes.

__interrupt void sciaRxIsr() {
    rxBuffer[rxIndex] = SciaRegs.SCIRXBUF.all;

    if(rxBuffer[rxIndex] == COM_START_SYM) {
        rxBuffer[0] = rxBuffer[rxIndex];
        rxIndex = 1;
    }
    else if(rxBuffer[rxIndex] == COM_STOP_SYM) {
        error = ParseCmd(rxBuffer, &command);
        if(!error) {
            char message[] = "Received!\n";
            sciaWriteString(message, sizeof(message));
            RespondCmd(&command);
        }
        rxIndex = 0;
    }
    else
        rxIndex ++;
    PieCtrlRegs.PIEACK.bit.ACK9 = 1;
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).