291,7 → 291,14 |
static s16 last_wp_event = 0; |
s16 tmp; |
s32 i1,i2; |
|
/* |
union |
{ |
unsigned char Byte[4]; |
unsigned int Int[2]; |
unsigned long Long; |
} Temp; |
*/ |
SPIWatchDog = 3500; // stop communication to FC after this timeout |
if(SPI_RxBuffer_Request) |
{ |
443,7 → 450,7 |
{ |
case 0: |
//Dezimalgrad --> Grad mit Dezimalminuten --> Grad, Minuten, Sekunden |
//53.285788 7.4847269 --> N53° 17.14728 E7° 29.08362 --> N53° 17' 8.837" E7° 29' 5.017" |
//53.28 5788 7.4847269 --> N53° 17.14728 E7° 29.08362 --> N53° 17' 8.837" E7° 29' 5.017" |
ToFlightCtrl.Param.Byte[11] = HOTT_GPS_PACKET_ID; |
ToFlightCtrl.Param.Byte[0] = 3+3; // index +3, weil bei HoTT V4 3 Bytes eingeschoben wurden |
ToFlightCtrl.Param.Byte[1] = 9-1; // how many |
504,8 → 511,35 |
ToFlightCtrl.Param.Byte[1] = 2; // how many |
ToFlightCtrl.Param.Byte[2] = EarthMagneticField / (5 * 2); |
ToFlightCtrl.Param.Byte[3] = EarthMagneticInclination / 2; |
hott_index = 0; |
break; |
case 3: |
ToFlightCtrl.Param.Byte[11] = JETI_GPS_PACKET_ID1; |
ToFlightCtrl.Param.Byte[0] = 0; // index |
ToFlightCtrl.Param.Byte[1] = 4; // how many |
//JetiExData[14].Value = 53 * 0x10000 + 23467; |
if(GPSData.Position.Latitude < 0) ToFlightCtrl.Param.Byte[5] = 0x40; |
else ToFlightCtrl.Param.Byte[5] = 0x00; |
ToFlightCtrl.Param.Byte[4] = abs(GPSData.Position.Latitude)/10000000L; |
i2 = abs(GPSData.Position.Latitude)%10000000L; |
i2 *= 6; |
i2 /= 1000; |
ToFlightCtrl.Param.Byte[3] = i2 / 256; |
ToFlightCtrl.Param.Byte[2] = i2 % 256; |
break; |
case 4: |
ToFlightCtrl.Param.Byte[11] = JETI_GPS_PACKET_ID2; |
ToFlightCtrl.Param.Byte[0] = 0; // index |
ToFlightCtrl.Param.Byte[1] = 4; // how many |
if(GPSData.Position.Latitude < 0) ToFlightCtrl.Param.Byte[5] = 0x60; |
else ToFlightCtrl.Param.Byte[5] = 0x20; |
ToFlightCtrl.Param.Byte[4] = abs(GPSData.Position.Longitude)/10000000L; |
i2 = abs(GPSData.Position.Longitude)%10000000L; |
i2 *= 6; |
i2 /= 1000; |
ToFlightCtrl.Param.Byte[3] = i2 / 256; |
ToFlightCtrl.Param.Byte[2] = i2 % 256; |
hott_index = 0; |
break; |
default: |
ToFlightCtrl.Param.Byte[0] = 255; |
hott_index = 0; |