Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1886 → Rev 1887

/branches/dongfang_FC_rewrite/uart0.c/uart0.c
131,7 → 131,7
"GyroYaw ", //5
"GYRO_RATE_FACTOR",
"GYRO_RATE_FACTOR",
"unused ",
"AttitudeControl ",
"AccPitch (angle)",
"AccRoll (angle) ", //10
"UBat ",
214,7 → 214,7
UCSR0B |= (1 << TXCIE0);
 
// initialize the debug timer
DebugData_Timer = SetDelay(DebugData_Interval);
DebugData_Timer = setDelay(DebugData_Interval);
 
// unlock rxd_buffer
rxd_buffer_locked = FALSE;
225,7 → 225,7
txd_complete = TRUE;
 
#ifdef USE_MK3MAG
Compass_Timer = SetDelay(220);
Compass_Timer = setDelay(220);
#endif
 
UART_VersionInfo.SWMajor = VERSION_MAJOR;
705,14 → 705,14
ConfirmFrame = 0;
}
 
if (((DebugData_Interval && CheckDelay(DebugData_Timer)) || request_DebugData)
if (((DebugData_Interval && checkDelay(DebugData_Timer)) || request_DebugData)
&& txd_complete) {
SendOutData('D', FC_ADDRESS, 1, (uint8_t *) &DebugOut, sizeof(DebugOut));
DebugData_Timer = SetDelay(DebugData_Interval);
DebugData_Timer = setDelay(DebugData_Interval);
request_DebugData = FALSE;
}
 
if (((Data3D_Interval && CheckDelay(Data3D_Timer)) || request_Data3D)
if (((Data3D_Interval && checkDelay(Data3D_Timer)) || request_Data3D)
&& txd_complete) {
SendOutData('C', FC_ADDRESS, 1, (uint8_t *) &Data3D, sizeof(Data3D));
Data3D.AngleNick = (int16_t) ((10 * angle[PITCH])
720,7 → 720,7
Data3D.AngleRoll = (int16_t) ((10 * angle[ROLL])
/ GYRO_DEG_FACTOR_PITCHROLL); // convert to multiple of 0.1°
Data3D.Heading = (int16_t) ((10 * yawGyroHeading) / GYRO_DEG_FACTOR_YAW); // convert to multiple of 0.1°
Data3D_Timer = SetDelay(Data3D_Interval);
Data3D_Timer = setDelay(Data3D_Interval);
request_Data3D = FALSE;
}
 
731,7 → 731,7
}
 
#ifdef USE_MK3MAG
if((CheckDelay(Compass_Timer)) && txd_complete) {
if((checkDelay(Compass_Timer)) && txd_complete) {
ToMk3Mag.Attitude[0] = (int16_t)((10 * angle[PITCH]) / GYRO_DEG_FACTOR_PITCHROLL); // approx. 0.1 deg
ToMk3Mag.Attitude[1] = (int16_t)((10 * angle[ROLL]) / GYRO_DEG_FACTOR_PITCHROLL); // approx. 0.1 deg
ToMk3Mag.UserParam[0] = dynamicParams.UserParams[0];
740,7 → 740,7
SendOutData('w', MK3MAG_ADDRESS, 1,(uint8_t *) &ToMk3Mag,sizeof(ToMk3Mag));
// the last state is 5 and should be send only once to avoid multiple flash writing
if(compassCalState > 4) compassCalState = 0;
Compass_Timer = SetDelay(99);
Compass_Timer = setDelay(99);
}
#endif