Rev 116 | Rev 119 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 116 | Rev 117 | ||
---|---|---|---|
Line 87... | Line 87... | ||
87 | u8 UART0_rbuffer[UART0_RX_BUFFER_LEN]; |
87 | u8 UART0_rbuffer[UART0_RX_BUFFER_LEN]; |
88 | Buffer_t UART0_rx_buffer; |
88 | Buffer_t UART0_rx_buffer; |
Line 89... | Line 89... | ||
89 | 89 | ||
90 | u8 UART0_Request_VersionInfo = FALSE; |
90 | u8 UART0_Request_VersionInfo = FALSE; |
- | 91 | u8 UART0_Request_NaviData = FALSE; |
|
91 | u8 UART0_Request_NaviData = FALSE; |
92 | u8 UART0_Request_ErrorMessage = FALSE; |
92 | u32 UART0_NaviData_Timer; |
93 | u32 UART0_NaviData_Timer; |
Line 93... | Line 94... | ||
93 | u32 UART0_NaviData_Interval = 0; // in ms |
94 | u32 UART0_NaviData_Interval = 0; // in ms |
94 | 95 | ||
Line 319... | Line 320... | ||
319 | break; |
320 | break; |
Line 320... | Line 321... | ||
320 | 321 | ||
321 | case NC_ADDRESS: // own Slave Address |
322 | case NC_ADDRESS: // own Slave Address |
322 | switch(SerialMsg.CmdID) |
323 | switch(SerialMsg.CmdID) |
- | 324 | { |
|
- | 325 | case 'e': // request for the text of the error status |
|
- | 326 | UART0_Request_ErrorMessage = TRUE; |
|
- | 327 | break; |
|
- | 328 | case 'o': // request for navigation information |
|
- | 329 | UART0_NaviData_Interval = (u32) SerialMsg.pData[0] * 10; |
|
- | 330 | if(UART0_NaviData_Interval > 0) UART0_Request_NaviData = TRUE; |
|
323 | { |
331 | break; |
324 | default: |
332 | default: |
325 | break; |
333 | break; |
326 | } // case NC_ADDRESS |
334 | } // case NC_ADDRESS |
Line 327... | Line 335... | ||
327 | // "break;" is missing here to fall thru to the common commands |
335 | // "break;" is missing here to fall thru to the common commands |
328 | 336 | ||
329 | default: // and any other Slave Address |
337 | default: // and any other Slave Address |
330 | switch(SerialMsg.CmdID) // check CmdID |
- | |
331 | { |
- | |
332 | case 'o': // request for navigation information |
- | |
333 | UART0_NaviData_Interval = (u32) SerialMsg.pData[0] * 10; |
- | |
334 | if(UART0_NaviData_Interval > 0) UART0_Request_NaviData = TRUE; |
- | |
335 | break; |
338 | switch(SerialMsg.CmdID) // check CmdID |
336 | 339 | { |
|
337 | case 'v': // request for version info |
340 | case 'v': // request for version info |
338 | UART0_Request_VersionInfo = TRUE; |
341 | UART0_Request_VersionInfo = TRUE; |
339 | break; |
342 | break; |
Line 374... | Line 377... | ||
374 | { |
377 | { |
375 | if(DebugUART == UART0) return; |
378 | if(DebugUART == UART0) return; |
376 | UART0_Transmit(); // output pending bytes in tx buffer |
379 | UART0_Transmit(); // output pending bytes in tx buffer |
377 | if(UART0_tx_buffer.Locked == TRUE) return; |
380 | if(UART0_tx_buffer.Locked == TRUE) return; |
Line -... | Line 381... | ||
- | 381 | ||
- | 382 | if(UART0_Request_ErrorMessage && (UART0_tx_buffer.Locked == FALSE)) |
|
- | 383 | { |
|
- | 384 | MKProtocol_CreateSerialFrame(&UART0_tx_buffer, 'E', NC_ADDRESS, 1, (u8 *)&ErrorMSG, sizeof(ErrorMSG)); |
|
378 | 385 | UART0_Request_ErrorMessage = FALSE; |
|
379 | 386 | } |
|
380 | if(UART0_Request_VersionInfo && (UART0_tx_buffer.Locked == FALSE)) |
387 | if(UART0_Request_VersionInfo && (UART0_tx_buffer.Locked == FALSE)) |
381 | { |
388 | { |
382 | MKProtocol_CreateSerialFrame(&UART0_tx_buffer, 'V', NC_ADDRESS,1, (u8 *)&UART_VersionInfo, sizeof(UART_VersionInfo)); |
389 | MKProtocol_CreateSerialFrame(&UART0_tx_buffer, 'V', NC_ADDRESS,1, (u8 *)&UART_VersionInfo, sizeof(UART_VersionInfo)); |
383 | UART0_Request_VersionInfo = FALSE; |
390 | UART0_Request_VersionInfo = FALSE; |