Subversion Repositories NaviCtrl

Rev

Rev 171 | Rev 195 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 171 Rev 190
Line 301... Line 301...
301
void UART0_ProcessRxData(void)
301
void UART0_ProcessRxData(void)
302
{
302
{
303
        SerialMsg_t SerialMsg;
303
        SerialMsg_t SerialMsg;
304
        // if data in the rxd buffer are not locked immediately return
304
        // if data in the rxd buffer are not locked immediately return
305
        if((UART0_rx_buffer.Locked == FALSE) || (DebugUART == UART0) ) return;
305
        if((UART0_rx_buffer.Locked == FALSE) || (DebugUART == UART0) ) return;
306
       
-
 
307
        MKProtocol_DecodeSerialFrame(&UART0_rx_buffer, &SerialMsg); // decode serial frame in rxd buffer
-
 
Line -... Line 306...
-
 
306
 
-
 
307
        MKProtocol_DecodeSerialFrameHeader(&UART0_rx_buffer, &SerialMsg); // decode serial frame in rxd buffer  
-
 
308
        MKProtocol_DecodeSerialFrameData(&UART0_rx_buffer, &SerialMsg); // decode serial frame in rxd buffer
308
 
309
 
309
        switch(*SerialMsg.pAddress) // check for Slave Address
310
        switch(SerialMsg.Address) // check for Slave Address
310
        {
311
        {
311
                case MKOSD_ADDRESS: // answers from the MKOSD
312
                case MKOSD_ADDRESS: // answers from the MKOSD
312
                        switch(*SerialMsg.pCmdID)
313
                        switch(SerialMsg.CmdID)
313
                        {
314
                        {
314
                                case 'V':
315
                                case 'V':
315
                                        memcpy(&MKOSD_VersionInfo, SerialMsg.pData, sizeof(MKOSD_VersionInfo)); // copy echo pattern
316
                                        memcpy(&MKOSD_VersionInfo, SerialMsg.pData, sizeof(MKOSD_VersionInfo)); // copy echo pattern
316
                                        break;
317
                                        break;
317
                                default:
318
                                default:
318
                                        break;
319
                                        break;
319
                        } // case MKOSD_ADDRESS 
320
                        } // case MKOSD_ADDRESS 
Line 320... Line 321...
320
                        break;
321
                        break;
321
 
322
 
322
                case NC_ADDRESS:  // own Slave Address
323
                case NC_ADDRESS:  // own Slave Address
323
                        switch(*SerialMsg.pCmdID)
324
                        switch(SerialMsg.CmdID)
324
                        {
325
                        {
325
                                case 'e': // request for the text of the error status
326
                                case 'e': // request for the text of the error status
326
                                        UART0_Request_ErrorMessage = TRUE;
327
                                        UART0_Request_ErrorMessage = TRUE;
Line 333... Line 334...
333
                                        break;
334
                                        break;
334
                        } // case NC_ADDRESS
335
                        } // case NC_ADDRESS
335
                        // "break;" is missing here to fall thru to the common commands
336
                        // "break;" is missing here to fall thru to the common commands
Line 336... Line 337...
336
 
337
 
337
                default:  // and any other Slave Address
338
                default:  // and any other Slave Address
338
                        switch(*SerialMsg.pCmdID) // check CmdID
339
                        switch(SerialMsg.CmdID) // check CmdID
339
                        {
340
                        {
340
                                case 'v': // request for version info
341
                                case 'v': // request for version info
341
                                        UART0_Request_VersionInfo = TRUE;
342
                                        UART0_Request_VersionInfo = TRUE;
342
                                        break;
343
                                        break;