Rev 189 | Rev 191 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 189 | Rev 190 | ||
---|---|---|---|
Line 356... | Line 356... | ||
356 | if(UART1_rx_buffer.Locked == FALSE) return; |
356 | if(UART1_rx_buffer.Locked == FALSE) return; |
Line 357... | Line 357... | ||
357 | 357 | ||
358 | Waypoint_t * pWaypoint = NULL; |
358 | Waypoint_t * pWaypoint = NULL; |
Line -... | Line 359... | ||
- | 359 | SerialMsg_t SerialMsg; |
|
- | 360 | ||
- | 361 | // analyze header first |
|
- | 362 | MKProtocol_DecodeSerialFrameHeader(&UART1_rx_buffer, &SerialMsg); |
|
- | 363 | if( (SerialMsg.Address == FC_ADDRESS) && (SerialMsg.CmdID == 'y') ) |
|
- | 364 | { |
|
- | 365 | if(Buffer_Copy(&UART1_rx_buffer, &UART2_tx_buffer)) |
|
- | 366 | { |
|
- | 367 | DebugOut.Analog[31]++; |
|
- | 368 | } |
|
- | 369 | Buffer_Clear(&UART1_rx_buffer); // free rc buffer for next frame |
|
- | 370 | return; |
|
359 | SerialMsg_t SerialMsg; |
371 | } |
360 | 372 | ||
361 | MKProtocol_DecodeSerialFrame(&UART1_rx_buffer, &SerialMsg); // decode serial frame in rxd buffer |
373 | MKProtocol_DecodeSerialFrameData(&UART1_rx_buffer, &SerialMsg); // decode serial frame in rxd buffer |
362 | if(*(SerialMsg.pCmdID) != 'z') SerialLinkOkay = 250; // reset SerialTimeout, but not in case of the "ping" |
374 | if(SerialMsg.CmdID != 'z') SerialLinkOkay = 250; // reset SerialTimeout, but not in case of the "ping" |
363 | switch(*(SerialMsg.pAddress)) // check for Slave Address |
375 | switch(SerialMsg.Address) // check for Slave Address |
364 | { |
376 | { |
365 | case NC_ADDRESS: // own Slave Address |
377 | case NC_ADDRESS: // own Slave Address |
366 | switch(*(SerialMsg.pCmdID)) |
378 | switch(SerialMsg.CmdID) |
367 | { |
379 | { |
368 | case 'z': // connection checker |
380 | case 'z': // connection checker |
369 | memcpy(&Echo, SerialMsg.pData, sizeof(Echo)); // copy echo pattern |
381 | memcpy(&Echo, SerialMsg.pData, sizeof(Echo)); // copy echo pattern |
Line 469... | Line 481... | ||
469 | } // case NC_ADDRESS |
481 | } // case NC_ADDRESS |
470 | // "break;" is missing here to fall thru to the common commands |
482 | // "break;" is missing here to fall thru to the common commands |
Line 471... | Line 483... | ||
471 | 483 | ||
Line 472... | Line 484... | ||
472 | default: // and any other Slave Address |
484 | default: // and any other Slave Address |
473 | 485 | ||
474 | switch(*(SerialMsg.pCmdID)) // check CmdID |
486 | switch(SerialMsg.CmdID) // check CmdID |
475 | { |
487 | { |
476 | case 'a':// request for the labels of the analog debug outputs |
488 | case 'a':// request for the labels of the analog debug outputs |
477 | UART1_Request_DebugLabel = SerialMsg.pData[0]; |
489 | UART1_Request_DebugLabel = SerialMsg.pData[0]; |