Rev 529 | Rev 531 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 529 | Rev 530 | ||
---|---|---|---|
Line 131... | Line 131... | ||
131 | #define UART1_RX_FIFO_LEN 1024 |
131 | #define UART1_RX_FIFO_LEN 1024 |
132 | u8 UART1_rxfifobuffer[UART1_RX_FIFO_LEN]; |
132 | u8 UART1_rxfifobuffer[UART1_RX_FIFO_LEN]; |
133 | fifo_t UART1_rx_fifo; |
133 | fifo_t UART1_rx_fifo; |
Line 134... | Line 134... | ||
134 | 134 | ||
135 | // the rx buffer |
135 | // the rx buffer |
136 | #define UART1_RX_BUFFER_LEN 1024 |
136 | #define UART1_RX_BUFFER_LEN 1024 |
137 | u8 UART1_rbuffer[UART1_RX_BUFFER_LEN]; |
137 | u8 UART1_rbuffer[UART1_RX_BUFFER_LEN]; |
Line 138... | Line 138... | ||
138 | Buffer_t UART1_rx_buffer; |
138 | Buffer_t UART1_rx_buffer; |
139 | 139 | ||
140 | // the tx buffer |
140 | // the tx buffer |
141 | #define UART1_TX_BUFFER_LEN 1024 |
141 | #define UART1_TX_BUFFER_LEN 1024 |
Line 142... | Line 142... | ||
142 | u8 UART1_tbuffer[UART1_TX_BUFFER_LEN]; |
142 | u8 UART1_tbuffer[UART1_TX_BUFFER_LEN]; |
Line 432... | Line 432... | ||
432 | case 't': // request for the GPS time |
432 | case 't': // request for the GPS time |
433 | UART1_Request_SystemTime = TRUE; |
433 | UART1_Request_SystemTime = TRUE; |
434 | break; |
434 | break; |
Line 435... | Line 435... | ||
435 | 435 | ||
- | 436 | case 'm': // request for the license string |
|
436 | case 'm': // request for the license string |
437 | if(UART_VersionInfo.HWMajor < 20) break; // this command is not supported on old Hardware -> they don't have an EEPROM |
437 | UART1_Request_LicenseString = SerialMsg.pData[0]; |
438 | UART1_Request_LicenseString = SerialMsg.pData[0]; |
438 | if(UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) |
439 | if(UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) |
439 | { |
440 | { |
440 | memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy ftp parameter |
441 | memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy ftp parameter |
Line 1130... | Line 1131... | ||
1130 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
1131 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
1131 | } |
1132 | } |
1132 | else |
1133 | else |
1133 | if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN)) |
1134 | if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN)) |
1134 | { |
1135 | { |
1135 | result = LIC_CMD_WRITE_LICENSE; |
- | |
1136 | if(CheckLicense(CHECK_ONLY)) //new license is okay |
1136 | if(CheckLicense(CHECK_ONLY)) //new license is okay |
1137 | { |
1137 | { |
1138 | WriteLicenseToEEPROM(EEPROM_LICENSE_DATA_KOMPATIBEL); |
1138 | WriteLicenseToEEPROM(EEPROM_LICENSE_DATA_KOMPATIBEL); |
1139 | result = 0; |
1139 | result = 1; |
1140 | } |
1140 | } |
1141 | else //new license is NOT okay |
1141 | else //new license is NOT okay |
1142 | { |
1142 | { |
1143 | ClearLicenseText(); |
1143 | ClearLicenseText(); |
1144 | CheckLicense(GET_LICENSE); // fetch a license if available |
1144 | result = CheckLicense(GET_LICENSE); // fetch a license if available |
1145 | } |
1145 | } |
1146 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
1146 | //MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 1, &result, 1); |
- | 1147 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'M', NC_ADDRESS, 2, &result, 1, LicensePtr, LICENSE_SIZE); |
|
1147 | } |
1148 | } |
1148 | UART1_Request_LicenseString = 0; |
1149 | UART1_Request_LicenseString = 0; |
1149 | } |
1150 | } |
1150 | #ifdef FOLLOW_ME |
1151 | #ifdef FOLLOW_ME |
1151 | else if(CheckDelay(UART1_FollowMe_Timer) && (UART1_tx_buffer.Locked == FALSE)) |
1152 | else if(CheckDelay(UART1_FollowMe_Timer) && (UART1_tx_buffer.Locked == FALSE)) |