Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 461 → Rev 462

/trunk/main.h
14,7 → 14,7
 
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_PATCH 3
#define VERSION_PATCH 4
// 0 = A
// 1 = B
// 2 = C
39,7 → 39,7
#define VERSION_SERIAL_MINOR 0
 
#ifndef FOLLOW_ME
#define FC_SPI_COMPATIBLE 55
#define FC_SPI_COMPATIBLE 56
#else
#define FC_SPI_COMPATIBLE 0xFF
#endif
/trunk/spi_slave.c
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;
/trunk/spi_slave.h
102,6 → 102,8
#define HOTT_GPS_PACKET_ID 0x8A
#define HOTT_ELECTRIC_AIR_PACKET_ID 0x8E
#define HOTT_GENERAL_PACKET_ID 0x8D
#define JETI_GPS_PACKET_ID1 0x01
#define JETI_GPS_PACKET_ID2 0x02
 
typedef struct
{