/trunk/gpx.c |
---|
72,6 → 72,7 |
#include "uart0.h" |
#include "settings.h" |
#include "crc16.h" |
#include "camctrl.h" |
u16 Check16File; |
705,6 → 706,12 |
sprintf(string, "<GPSInfo>%d,%d,%d</GPSInfo>\r\n",FreqNewGpsData,GPSData.Flags,GPSData.SatFix); // FreqGpsNavProcessed |
CheckSumAndWrite(&Check16Block,string, doc->file); |
if(FromLaserCtrl.LaserStatus) |
{ |
sprintf(string, "<Laser>%d.%02d</Laser>\r\n",FromLaserCtrl.Distance/100,abs(FromLaserCtrl.Distance)%100); // FreqGpsNavProcessed |
CheckSumAndWrite(&Check16Block,string, doc->file); |
} |
// sprintf(string, "<FCTemperat>%d</FCTemperat>\r\n",FC_Temperatur); |
// CheckSumAndWrite(&Check16Block,string, doc->file); |
/trunk/main.c |
---|
507,6 → 507,8 |
} |
if(CanbusTimeOut >= 2) CanbusTimeOut--; |
if(LaserCtrlTimeout) LaserCtrlTimeout--; else FromLaserCtrl.Distance = 0; |
if(CamCtrlTimeout) |
{ |
if(--CamCtrlTimeout == 1) CamCtrlCharacter = '?'; |
522,6 → 524,7 |
Analog_Update(); // get new ADC values |
CalcHeadFree(); |
if(CamCtrlTimeout > 1) CamCtrl_GetData(3); |
if(LaserCtrlTimeout > 1) LaserCtrl_GetData(3); |
if(UART_VersionInfo.HWMajor >= 30) ProcessCanBus(); |
if(!CheckDelay(SPI0_Timeout)) TimeoutGPS_Process = 0; |
else if(CountMilliseconds - SPI0_Timeout > 30000000L) SPI0_Timeout = CountMilliseconds; // avoid too long overflows |
763,6 → 766,16 |
} |
else CamCtrlTimeout = 0; // disable CamCtrl communication if external compass is connected |
// +++++++++++++++++++++++++++++++++++++++ |
// +++++++++++++++++++++++++++++++++++++++ |
// ++ check LaserCtrl version (if connected) |
if(Compass_I2CPort == NCMAG_PORT_INTERN) |
{ |
if(I2CBus_LockBuffer(I2C0,3)) I2CBus_Transmission(I2C0, LASER_SLAVE_ADDRESS, &ToLaserCtrl, 4, &LaserCtrl_UpdateData, sizeof(FromLaserCtrl)); |
} |
else LaserCtrlTimeout = 0; // disable CamCtrl communication if external compass is connected |
// +++++++++++++++++++++++++++++++++++++++ |
GPS_Init(); |
// ---------- Prepare the isr driven |
// set to absolute lowest priority |
796,6 → 809,16 |
} |
else if(Compass_I2CPort == NCMAG_PORT_INTERN) UART1_PutString(" No CamCtrl connected \r\n"); |
if(FromLaserCtrl.LaserStatus) |
{ |
u8 msg[30]; |
sprintf(msg, " LaserCtrl found V%i.%02i ",1 + FromLaserCtrl.Version / 100, FromLaserCtrl.Version % 100); |
UART1_PutString(msg); |
if(!(FromLaserCtrl.LaserStatus & LASER_DATA_OK)) UART1_PutString("... but no Laser data!\r\n"); |
else UART1_PutString("okay\r\n"); |
} |
else if(Compass_I2CPort == NCMAG_PORT_INTERN) UART1_PutString(" No LaserCtrl connected \r\n"); |
// ++++++++++++++++++++++++++++++++++++++++++++++ |
for (;;) // the endless main loop |
{ |
/trunk/menu.c |
---|
81,7 → 81,7 |
u8 MenuItem = 0; |
u8 MaxMenuItem = 31; |
u8 MaxMenuItem = 32; |
void Menu_Putchar(char c) |
{ |
700,7 → 700,23 |
} |
} |
break; |
case 31: // Temperaturecompensation of the Barosensor |
case 31: |
LCD_printfxy(0,0,"LaserCtrl"); |
if(!(FromLaserCtrl.LaserStatus & LASER_I2C_OK)) |
{ |
LCD_printfxy(0,2,"Not connected"); |
if(CamCtrlTimeout < 10) LCD_printfxy(14,3,"(conn)"); // connect manually |
if(Keys & KEY4) LaserCtrlTimeout = 65000; |
} |
else |
{ |
LCD_printfxy(10,0,"V%i.%02i",1 + FromLaserCtrl.Version / 100, FromLaserCtrl.Version % 100); |
LCD_printfxy(0,1,"Stat:"); |
if(FromLaserCtrl.LaserStatus & LASER_DATA_OK) LCD_printfxy(8,1,"OK") else LCD_printfxy(5,1,"No Laser"); |
LCD_printfxy(0,2,"Dist:%5dcm",FromLaserCtrl.Distance); |
} |
break; |
case 32: // Temperaturecompensation of the Barosensor |
{ |
static s32 dT = 0, tAlt = 0, faktor = 0; |
static s32 dP = 0, pAlt = 0; |
/trunk/spi_slave.c |
---|
70,6 → 70,7 |
#include "params.h" |
#include "settings.h" |
#include "triggerlog.h" |
#include "camctrl.h" |
#define SPI_FCSYNCBYTE1 0xAA |
#define SPI_FCSYNCBYTE2 0x85 |
522,7 → 523,8 |
ToFlightCtrl.Param.sInt[5] = GyroCompassCorrected / 10; // Bytes 10 & 11 |
ToFlightCtrl.Param.Byte[12] = CamCtrlCharacter; |
ToFlightCtrl.Param.Byte[13] = BaroCalState; |
ToFlightCtrl.Param.sInt[7] = LuftdruckTemperaturOffset; // Bytes 14 & 15 |
ToFlightCtrl.Param.sInt[7] = LuftdruckTemperaturOffset; // Bytes 14 & 15 |
ToFlightCtrl.Param.Int[8] = FromLaserCtrl.Distance; // Bytes 16 & 17 |
break; |
case SPI_NCCMD_GPSINFO: |
706,6 → 708,10 |
// 3 = 6,7 |
// 4 = 8,9 |
// 5 = 10,11 |
// 6 = 12,13 |
// 7 = 14,15 |
// 8 = 16,17 |
// 9 = 18,19 |
} |
VIC_ITCmd(SSP0_ITLine, ENABLE); // enable SPI interrupt |
switch(FromFlightCtrl.Command) |
/trunk/triggerlog.c |
---|
69,6 → 69,7 |
#include "timer1.h" |
#include "gps.h" |
#include "spi_slave.h" |
#include "camctrl.h" |
u16 Logged_TRIG_Counter = 0; |
u16 TRIG_Filenum = 0; |
297,6 → 298,11 |
doc->state = TRIG_DOC_OPENED; // change document state to opened. At next a placemark has to be opened. |
sprintf(string, "#Counter;Time;Latitude;Longitude;GPSAltitude[m](raw);BaroAltitude[m];Compass[deg];ServoSetpoint(raw);ServoPoi[deg]"); |
fputs_(string, doc->file); |
if(FromLaserCtrl.LaserStatus) |
{ |
sprintf(string, ";Laser[m]"); |
fputs_(string, doc->file); |
} |
sprintf(string, "\r\n#%4i.%02i.%02i Nr:%i (%02i%02i%02i%02i.GPX)", SystemTime.Year, SystemTime.Month, SystemTime.Day, TRIG_Filenum, SystemTime.Year%100, SystemTime.Month, SystemTime.Day, GPX_Filenum); |
fputs_(string, doc->file); |
if(SimulationFlags) { sprintf(string, " SIMULATED"); fputs_(string, doc->file);}; |
369,7 → 375,12 |
// ServoSet; ServoPoi |
sprintf(string,";%d;%d.%d",TrigLogging.ServoControlNick,TrigLogging.ServoControlPoi/10,abs(TrigLogging.ServoControlPoi%10)); |
fputs_(string, doc->file); |
// laser connected? |
if(FromLaserCtrl.LaserStatus) |
{ |
sprintf(string,";%d.%02d",FromLaserCtrl.Distance/100,abs(FromLaserCtrl.Distance%100)); |
fputs_(string, doc->file); |
} |
Logged_TRIG_Counter++; |
retvalue = 1; |
} |
/trunk/uart1.c |
---|
182,7 → 182,7 |
"CompassHeading ", //10 |
"GyroHeading ", |
"SPI Error ", // achtung: muss auf 12 bleiben |
"GPS CRC Error ", |
"Laser [cm] ",//"GPS CRC Error ", |
"I2C Error ", |
"I2C Okay ", //15 |
"16 ", |
/trunk/ubx.c |
---|
575,7 → 575,7 |
} // EOF filter matches |
} // EOF != INVALID |
}// EOF crc ok |
else DebugOut.Analog[13]++; // CRC Error -> since 2.10e (6.2015) |
// else DebugOut.Analog[13]++; // CRC Error -> since 2.10e (6.2015) -> removed 11.2016 (V2.16) |
ubxState = UBXSTATE_IDLE; // ready to parse new data |
break; |