Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 762 → Rev 763

/trunk/uart1.c
478,7 → 478,8
UART1_Request_LicenseString = SerialMsg.pData[0];
if((UART1_Request_LicenseString == LIC_CMD_WRITE_LICENSE) && (UART_VersionInfo.HWMajor >= 20))
{
memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy ftp parameter
memcpy(LicensePtr, &SerialMsg.pData[1],LICENSE_SIZE_TEXT); // copy license
memcpy(&LicensePtr[460], &SerialMsg.pData[1+460],OEM_NAME_LENGHT); // copy license
}
break;
case 'f': // ftp command
1070,7 → 1071,7
NaviData_Flags.VarioCharacter = FromFC_VarioCharacter;
NaviData_Flags.GPS_ModeCharacter = NC_GPS_ModeCharacter;
NaviData_Flags.BL_MinOfMaxPWM = BL_MinOfMaxPWM;
crc_flags = CRC16((unsigned char*)(&NaviData_Flags.OSDStatusFlags2), sizeof(NaviData_Flags) - START_PAYLOAD_DATA); // update crc for the license structure
crc_flags = CRC16((unsigned char*)(&NaviData_Flags.OSDStatusFlags2), sizeof(NaviData_Flags) - START_PAYLOAD_DATA);
if((crc_flags != CRC_Flags) || (--count_flags == 0))
{
sent += MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'O', NC_ADDRESS, 1 , (u8 *)&NaviData_Flags, sizeof(NaviData_Flags)) + 1;
1092,7 → 1093,7
NaviData_Target.TargetLatitude = NaviData.TargetPosition.Latitude;
NaviData_Target.TargetAltitude = NaviData.TargetPosition.Altitude;
NaviData_Target.RC_Quality = NaviData.RC_Quality;
crc_target = CRC16((unsigned char*)(&NaviData_Target.TargetLongitude), sizeof(NaviData_Target) - START_PAYLOAD_DATA); // update crc for the license structure
crc_target = CRC16((unsigned char*)(&NaviData_Target.TargetLongitude), sizeof(NaviData_Target) - START_PAYLOAD_DATA);
if((crc_target != CRC_Target) || (--count_target == 0))
{
sent += MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'O', NC_ADDRESS, 1 , (u8 *)&NaviData_Target, sizeof(NaviData_Target)) + 1;
1113,7 → 1114,7
NaviData_WP.WaypointNumber = NaviData.WaypointNumber;
NaviData_WP.TargetHoldTime = NaviData.TargetHoldTime;
// NaviData_WP.WP_Eventchannel = FC_WP_EventChannel; -> happends already in SPI.c
crc_wp = CRC16((unsigned char*)(&NaviData_WP.WaypointIndex), sizeof(NaviData_WP) - START_PAYLOAD_DATA); // update crc for the license structure
crc_wp = CRC16((unsigned char*)(&NaviData_WP.WaypointIndex), sizeof(NaviData_WP) - START_PAYLOAD_DATA); // update crc
if((crc_wp != CRC_Wp) || (--count_wp == 0))
{
sent += MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'O', NC_ADDRESS, 1 , (u8 *)&NaviData_WP, sizeof(NaviData_WP)) + 1;
1132,7 → 1133,7
NaviData_Failsafe.OSDStatusFlags = (FC.StatusFlags & OSD_FLAG_MASK1) | (FC.StatusFlags2 & OSD_FLAG_MASK2);
NaviData_Failsafe.Longitude = GPS_FailsafePosition.Longitude;
NaviData_Failsafe.Latitude = GPS_FailsafePosition.Latitude;
crc_fs = CRC16((unsigned char*)(&NaviData_Failsafe.Longitude), sizeof(NaviData_Pos_t) - START_PAYLOAD_DATA); // update crc for the license structure
crc_fs = CRC16((unsigned char*)(&NaviData_Failsafe.Longitude), sizeof(NaviData_Pos_t) - START_PAYLOAD_DATA); // update crc for the structure
if((crc_fs != CRC_Fs) || (--count_fs == 0))
{
sent += MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'O', NC_ADDRESS, 1 , (u8 *)&NaviData_Failsafe, sizeof(NaviData_Failsafe)) + 1;
1153,7 → 1154,7
NaviData_Home.HomeLatitude = NaviData.HomePosition.Latitude;
NaviData_Home.HomeAltitude = NaviData.HomePosition.Altitude;
NaviData_Home.WP_OperatingRadius = MaxWP_Radius_in_m;
crc_home = CRC16((unsigned char*)(&NaviData_Home.HomeLongitude), sizeof(NaviData_Home_t) - START_PAYLOAD_DATA); // update crc for the license structure
crc_home = CRC16((unsigned char*)(&NaviData_Home.HomeLongitude), sizeof(NaviData_Home_t) - START_PAYLOAD_DATA); // update crc for the structure
if((crc_home != CRC_Home) || (--count_home == 0))
{
sent += MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'O', NC_ADDRESS, 1 , (u8 *)&NaviData_Home, sizeof(NaviData_Home)) + 1;
1541,6 → 1542,17
FollowMe.Name[3] = 'L'; // Name of that point (ASCII)
FollowMe.reserve[0] = 0; // reserve
FollowMe.reserve[1] = 0; // reserve
/*
{
static u32 distance;
distance = (10 + distance + AnalogData.Ch5 * 5) / 2;
GPSPos_ShiftGeodetic(&(FollowMe.Position), (s16)GyroCompassCorrected/10, distance);
FollowMe.Heading = (s16)GyroCompassCorrected/10;
FollowMe.CamAngle = 0; // Camera servo angle in degree (255 -> POI-Automatic)
FollowMe.Speed = 50 + GPSData.Speed_Ground / 10;
}
*/
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 's', NC_ADDRESS, 1, (u8 *)&FollowMe, sizeof(FollowMe));
}
UART1_FollowMe_Timer = SetDelay(FOLLOW_ME_INTERVAL); // set new update time
/trunk/uart1.h
372,7 → 372,7
u8 Feature[128];
u8 Expire[11];
u8 License[16];
} __attribute__((packed)) LicenseS_t; // from FC
} __attribute__((packed)) LicenseS_t;
extern u8 *LicensePtr;
 
extern u32 NMEA_Interval;// in ms