Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 325 → Rev 326

/trunk/i2c.c
262,7 → 262,7
{
I2C_GenerateSTOP (I2C1, ENABLE);
VIC_ITCmd(I2C1_ITLine, DISABLE);
LED_GRN_OFF;
// LED_GRN_OFF;
I2C_State = I2C_STATE_IDLE;
I2C_Error = I2C_ERROR_NONE;
return;
341,7 → 341,7
{ // stop communication
I2C_GenerateSTOP(I2C1, ENABLE); // generate stop condition to free the bus
VIC_ITCmd(I2C1_ITLine, DISABLE);
LED_GRN_OFF;
// LED_GRN_OFF;
I2C_State = I2C_STATE_IDLE; // ready for new actions
I2C_Error = I2C_ERROR_NONE;
}
365,7 → 365,7
I2C1_Timeout = SetDelay(I2C1_TIMEOUT);
DebugOut.Analog[15]++;
VIC_ITCmd(I2C1_ITLine, DISABLE);
LED_GRN_OFF;
// LED_GRN_OFF;
I2C_State = I2C_STATE_IDLE;
I2C_Error = I2C_ERROR_NONE;
return;
/trunk/main.h
14,7 → 14,7
 
#define VERSION_MAJOR 0
#define VERSION_MINOR 25
#define VERSION_PATCH 1
#define VERSION_PATCH 4
// 0 = A
// 1 = B
// 2 = C
/trunk/ncmag.c
570,12 → 570,13
if( (I2C_State == I2C_STATE_OFF) || !NCMAG_Present )
{
Compass_Heading = -1;
DebugOut.Analog[14]++; // count I2C error
return;
}
 
if(CheckDelay(TimerUpdate))
{
if(++send_config == 100) // every two seconds
if(Compass_Heading != -1) send_config = 0; // no re-configuration if value is valid
if(++send_config == 25) // 500ms
{
send_config = 0;
MagConfig.mode = MODE_CONTINUOUS;
589,7 → 590,7
Compass_UpdateCalState();
if(Compass_CalState) NCMAG_Calibrate();
NCMAG_GetMagVector(); //Get new data;
if(send_config == 99) TimerUpdate = SetDelay(5); // next event is the re-configuration
if(send_config == 24) TimerUpdate = SetDelay(5); // next event is the re-configuration
else TimerUpdate = SetDelay(20); // every 20 ms are 50 Hz
}
}
/trunk/spi_slave.c
400,21 → 400,21
FC.StatusFlags |= FromFlightCtrl.Param.Byte[8];
if(FC.StatusFlags & FC_STATUS_CALIBRATE && !FCCalibActive)
{
HeadFreeStartAngle = Compass_Heading * 10;
Compass_Init();
FCCalibActive = 1;
HeadFreeStartAngle = FromFlightCtrl.GyroHeading;
}
else
{
FCCalibActive = 0;
}
if(FC.StatusFlags & FC_STATUS_START) HeadFreeStartAngle = FromFlightCtrl.GyroHeading;
if(FC.StatusFlags & FC_STATUS_START) if(Compass_Heading != -1) HeadFreeStartAngle = Compass_Heading * 10; else HeadFreeStartAngle = FromFlightCtrl.GyroHeading;
 
if((Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) && (NCFlags & NC_FLAG_GPS_OK))
if((Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE))
{
if(!(FC.StatusFlags2 & FC_STATUS2_CAREFREE)) // CF ist jetzt ausgeschaltet -> neue Richtung lernen
{
if(NaviData.HomePositionDeviation.Distance > 200) // nur bei ausreichender Distance -> 20m
if((NaviData.HomePositionDeviation.Distance > 200) && (NCFlags & NC_FLAG_GPS_OK)) // nur bei ausreichender Distance -> 20m
{
HeadFreeStartAngle = (10 * NaviData.HomePositionDeviation.Bearing + 1800 + 3600 - Parameter.OrientationAngle * 150) % 3600; // in 0.1°
}
423,6 → 423,8
}
}
 
//DebugOut.Analog[16] = HeadFreeStartAngle;
 
Parameter.ActiveSetting = FromFlightCtrl.Param.Byte[9];
DebugOut.Analog[5] = FC.StatusFlags;
FC.StatusFlags2 = FromFlightCtrl.Param.Byte[11];
/trunk/uart1.c
149,7 → 149,7
"SPI Okay ",
"I2C Error ",
"I2C Okay ", //15
" ",// "Kalman_K ",
"16 ",// "Kalman_K ",
"ACC_Speed_N ",
"ACC_Speed_E ",
"Speed_z ",// "GPS ACC ",