master
Pawel Jalocha 2023-03-21 01:53:56 +00:00
rodzic 1983646f6b
commit e18b1b7ed5
3 zmienionych plików z 41 dodań i 27 usunięć

Wyświetl plik

@ -3,6 +3,20 @@
#define DEFAULT_CONbaud 115200
#define DEFAULT_PPSdelay 100
#define DEFAULT_FreqPlan 0
#define DEFAULT_DispPage 3 // Fab501 Page to Display After Boot or Reset
#define WIFI_ADDRESS_IP1 192 // 192.168.1.1 for IP Address
#define WIFI_ADDRESS_IP2 168
#define WIFI_ADDRESS_IP3 1
#define WIFI_ADDRESS_IP4 1
#define WIFI_ADDRESS_GW1 0 // 0.0.0.0 for Gateway
#define WIFI_ADDRESS_GW2 0
#define WIFI_ADDRESS_GW3 0
#define WIFI_ADDRESS_GW4 0
#define WIFI_ADDRESS_MK1 255 // 255.255.255.0 for Mask
#define WIFI_ADDRESS_MK2 255
#define WIFI_ADDRESS_MK3 255
#define WIFI_ADDRESS_MK4 0
// #define WITH_HELTEC // HELTEC module: PCB LED on GPI025
// #define WITH_TTGO // TTGO module: PCB LED on GPIO2, GPIO25 free to use as DAC2 output
@ -20,12 +34,13 @@
#define WITH_U8G2_SH1106 // the bigger OLED controller
#define WITH_U8G2_FLIP // flip the OLED screen
#define WITH_RFM95 // RF chip selection: FollowMe, HELTEC and TTGO use sx1276 which is same as RFM95 module
#define WITH_RFM95 // RF chip selection: both HELTEC and TTGO use sx1276 which is same as RFM95
// #define WITH_SX1262 // RF chip selection: both HELTEC and TTGO use sx1276 which is same as RFM95
// #define WITH_SLEEP // with software sleep mode controlled by the long-press on the button
// #define WITH_AXP // with AXP192 power controller (T-BEAM V1.0)
// #define WITH_BQ // with BQ24295 power controller (new FollowMe)
// #define WITH_BQ // with BQ24295 power controller (FollowMe)
// #define WITH_LED_RX
// #define WITH_LED_TX
@ -40,15 +55,15 @@
// #define WITH_MAVLINK
// #define WITH_GPS_UBX_PASS // to pass directly UBX packets to/from GPS
// #define WITH_GPS_NMEA_PASS // to pass directly NMEA to/from GPS
// #define WITH_GPS_NMEA_PASS // to pass directly NMEA to/from GPS
// #define WITH_BMP180 // BMP180 pressure sensor
// #define WITH_BMP280 // BMP280 pressure sensor
#define WITH_BME280 // BMP280 with humidity (still works with BMP280)
#define WITH_BME280 // BMP280 with humidity (but still works with BMP280)
// #define WITH_MS5607 // MS5607 pressure sensor
#define WITH_PFLAA // $PFLAU and $PFLAA for compatibility with XCsoar and LK8000
// #define WITH_POGNT // $POGNT for traffic info
#define WITH_PFLAA // PFLAU and PFLAA for compatibility with XCsoar and LK8000
// #define WITH_POGNT
#define WITH_LOOKOUT
#define WITH_CONFIG // interpret the console input: $POGNS to change parameters
@ -59,23 +74,23 @@
// #define WITH_KNOB
// #define WITH_VARIO
#define WITH_LORAWAN // LoRaWAN TTN connectivity
// #define WITH_PAW // beta-code for PilotAware transmission
// #define WITH_FANET // beta-code for FANET transmissions, but breaks LoRaWAN, to be improved
#define WITH_ADSL
// #define WITH_PAW
#define WITH_FANET
#define WITH_LORAWAN
#define WITH_AP // create WiFi Access Point for data, setup and log files
#define WITH_AP_BUTTON // activate Access Point only when button pressed at startup
#define WITH_HTTP // HTTP server, works with AP and Stratux
#define WITH_BT_SPP // (classic) Bluetooth serial port for smartphone/tablet link
#define WITH_AP // WiFi Access Point: can work together with BT_SPP
// #define WITH_AP_BUTTON // only starts when button pressed at sartup
// #define WITH_BT_SPP // Bluetooth serial port for smartphone/tablet link: can work together with WiFi Access point
// #define WITH_STRATUX // beta-code: connect to Stratux WiFi and serve as GPS and OGN transmitter/receiver
// #define WITH_APRS // alpha-code: attempt to connect to the wifi router for uploading the log files to APRS
// #define WITH_STRATUX // beta-code: connect to Stratux WiFi and send GPS and traffic info
#define WITH_APRS // alpha-code: attempt to connect to the wifi router for uploading the log files to APRS
#define WITH_HTTP // HTTP server, works with AP dna should work with Stratux as well
#define WITH_SD // use the SD card in SPI mode and FAT file system
#define WITH_SPIFFS_FAT
#define WITH_SPIFFS // use SPIFFS file system in Flash
#define WITH_LOG // log own positions and other received to SPIFFS and possibly to uSD
#define WITH_SDLOG //
// #define WITH_ENCRYPT // Encrypt (optionally) the position

Wyświetl plik

@ -495,7 +495,7 @@ static void LCD_UpdateRelayList(bool Redraw=0)
uint8_t Lines=0;
for( uint8_t Idx=0; Idx<RelayQueueSize; Idx++)
{ if(PosY>(LCD_HEIGHT-2*LCD_FontHeight())) break;
OGN_RxPacket<OGN_Packet> *Packet = RelayQueue.Packet+Idx; if(Packet->Rank==0) continue;
OGN_RxPacket<OGN_Packet> *Packet = RelayQueue.Packet+Idx; if(Packet->Alloc==0) continue;
uint8_t Len=0;
Line[Len++]='0'+Packet->Packet.Header.AddrType;
Line[Len++]=':';

Wyświetl plik

@ -347,30 +347,29 @@ void OLED_DrawRelay(u8g2_t *OLED, GPS_Position *GPS)
{
const char *AcftTypeName[16] = { "----", "Glid", "Tow ", "Heli",
"SkyD", "Drop", "Hang", "Para",
"Pwrd", "Jet ", "UFO", "Ball",
"Zepp", "UAV", "Car ", "Fix " } ;
"Pwrd", "Jet ", "UFO ", "Ball",
"Zepp", "UAV ", "Car ", "Fix " } ;
u8g2_SetFont(OLED, u8g2_font_amstrad_cpc_extended_8r);
uint8_t Len=Format_String(Line, "Relay:");
if(GPS && GPS->Sec>=0) { Len+=Format_UnsDec(Line+Len, (uint16_t)(GPS->Sec), 2); Line[Len++]='s'; }
Line[Len]=0;
u8g2_DrawStr(OLED, 0, 24, Line);
// u8g2_SetFont(OLED, u8g2_font_amstrad_cpc_extended_8r);
// uint8_t Len=Format_String(Line, "Relay:");
// if(GPS && GPS->Sec>=0) { Len+=Format_UnsDec(Line+Len, (uint16_t)(GPS->Sec), 2); Line[Len++]='s'; }
// Line[Len]=0;
// u8g2_DrawStr(OLED, 0, 24, Line);
uint8_t LineIdx=1;
for( uint8_t Idx=0; Idx<RelayQueueSize; Idx++)
{ OGN_RxPacket<OGN_Packet> *Packet = RelayQueue.Packet+Idx; if(Packet->Alloc==0) continue;
if(Packet->Packet.Header.NonPos) continue;
uint8_t Len=0;
uint32_t Dist= IntDistance(Packet->LatDist, Packet->LonDist); // [m]
uint32_t Dir = IntAtan2(Packet->LonDist, Packet->LatDist); // [16-bit cyclic]
Dir &= 0xFFFF; Dir = (Dir*360)>>16; // [deg]
uint8_t Len=0;
Len+=Format_String(Line+Len, AcftTypeName[Packet->Packet.Position.AcftType]);
Line[Len++]=' ';
Len+=Format_UnsDec(Line+Len, Packet->Packet.DecodeAltitude()); // [m] altitude
Len+=Format_UnsDec(Line+Len, Packet->Packet.DecodeAltitude(), 4); // [m] altitude
Line[Len++]='m'; Line[Len++]=' ';
Len+=Format_UnsDec(Line+Len, Dir, 3); // [deg] direction to target
Line[Len++]=' ';
Len+=Format_UnsDec(Line+Len, (Dist+50)/100, 2, 1); // [km] distance to target
Len+=Format_UnsDec(Line+Len, (Dist+50)/100, 3, 1); // [km] distance to target
Len+=Format_String(Line+Len, "km");
/*
Line[Len++]='0'+Packet->Packet.Header.AddrType;