Rev 345 | Rev 351 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 345 | Rev 349 | ||
---|---|---|---|
Line 74... | Line 74... | ||
74 | #include "waypoints.h" |
74 | #include "waypoints.h" |
75 | #include "mkprotocol.h" |
75 | #include "mkprotocol.h" |
76 | #include "params.h" |
76 | #include "params.h" |
77 | #include "fifo.h" |
77 | #include "fifo.h" |
78 | #include "debug.h" |
78 | #include "debug.h" |
- | 79 | #include "ftphelper.h" |
|
Line 79... | Line 80... | ||
79 | 80 | ||
80 | #define FALSE 0 |
81 | #define FALSE 0 |
Line 81... | Line 82... | ||
81 | #define TRUE 1 |
82 | #define TRUE 1 |
Line 98... | Line 99... | ||
98 | u8 UART1_Request_ParameterId = 0; |
99 | u8 UART1_Request_ParameterId = 0; |
99 | u8 UART1_Request_Parameter = FALSE; |
100 | u8 UART1_Request_Parameter = FALSE; |
100 | u8 UART1_DisplayKeys = 0; |
101 | u8 UART1_DisplayKeys = 0; |
101 | u8 UART1_DisplayLine = 0; |
102 | u8 UART1_DisplayLine = 0; |
102 | u8 UART1_ConfirmFrame = 0; |
103 | u8 UART1_ConfirmFrame = 0; |
- | 104 | u8 UART1_Request_FTP = FALSE; |
|
- | 105 | ||
Line 103... | Line 106... | ||
103 | 106 | ||
Line 104... | Line 107... | ||
104 | UART_TypeDef *DebugUART = UART1; |
107 | UART_TypeDef *DebugUART = UART1; |
105 | 108 | ||
Line 118... | Line 121... | ||
118 | #define UART1_RX_BUFFER_LEN 150 |
121 | #define UART1_RX_BUFFER_LEN 150 |
119 | u8 UART1_rbuffer[UART1_RX_BUFFER_LEN]; |
122 | u8 UART1_rbuffer[UART1_RX_BUFFER_LEN]; |
120 | Buffer_t UART1_rx_buffer; |
123 | Buffer_t UART1_rx_buffer; |
Line 121... | Line 124... | ||
121 | 124 | ||
122 | // the tx buffer |
125 | // the tx buffer |
123 | #define UART1_TX_BUFFER_LEN 150 |
126 | #define UART1_TX_BUFFER_LEN 1024 |
124 | u8 UART1_tbuffer[UART1_TX_BUFFER_LEN]; |
127 | u8 UART1_tbuffer[UART1_TX_BUFFER_LEN]; |
Line 125... | Line 128... | ||
125 | Buffer_t UART1_tx_buffer; |
128 | Buffer_t UART1_tx_buffer; |
Line 393... | Line 396... | ||
393 | switch(SerialMsg.Address) // check for Slave Address |
396 | switch(SerialMsg.Address) // check for Slave Address |
394 | { |
397 | { |
395 | case NC_ADDRESS: // own Slave Address |
398 | case NC_ADDRESS: // own Slave Address |
396 | switch(SerialMsg.CmdID) |
399 | switch(SerialMsg.CmdID) |
397 | { |
400 | { |
- | 401 | ||
- | 402 | case 'f': // ftp command |
|
- | 403 | UART1_Request_FTP = SerialMsg.pData[0]; |
|
- | 404 | ||
- | 405 | //if (UART1_Request_FTP == FTP_CMD_SET_CWD || UART1_Request_FTP == FTP_CMD_GET_FILE) |
|
- | 406 | memcpy(&FTP_data, &SerialMsg.pData[1], sizeof(FTP_data)); // copy ftp parameter |
|
- | 407 | break; |
|
- | 408 | ||
398 | case 'z': // connection checker |
409 | case 'z': // connection checker |
399 | memcpy(&Echo, SerialMsg.pData, sizeof(Echo)); // copy echo pattern |
410 | memcpy(&Echo, SerialMsg.pData, sizeof(Echo)); // copy echo pattern |
400 | UART1_Request_Echo = TRUE; |
411 | UART1_Request_Echo = TRUE; |
401 | break; |
412 | break; |
Line 666... | Line 677... | ||
666 | { |
677 | { |
667 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'Z', NC_ADDRESS, 1, &Echo, sizeof(Echo)); // answer the echo request |
678 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'Z', NC_ADDRESS, 1, &Echo, sizeof(Echo)); // answer the echo request |
668 | Echo = 0; // reset echo value |
679 | Echo = 0; // reset echo value |
669 | UART1_Request_Echo = FALSE; |
680 | UART1_Request_Echo = FALSE; |
670 | } |
681 | } |
- | 682 | else if(UART1_Request_FTP && (UART1_tx_buffer.Locked == FALSE)) |
|
- | 683 | { |
|
- | 684 | CheckFTPCommand(UART1_Request_FTP); |
|
- | 685 | UART1_Request_FTP = FALSE; |
|
- | 686 | } |
|
671 | else if((UART1_Request_WritePoint!= 0xFF) && (UART1_tx_buffer.Locked == FALSE)) |
687 | else if((UART1_Request_WritePoint!= 0xFF) && (UART1_tx_buffer.Locked == FALSE)) |
672 | { |
688 | { |
673 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'W', NC_ADDRESS, 1, &UART1_Request_WritePoint, sizeof(UART1_Request_WritePoint)); |
689 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'W', NC_ADDRESS, 1, &UART1_Request_WritePoint, sizeof(UART1_Request_WritePoint)); |
674 | UART1_Request_WritePoint = 0xFF; |
690 | UART1_Request_WritePoint = 0xFF; |
675 | } |
691 | } |