kopia lustrzana https://github.com/pjalocha/esp32-ogn-tracker
Log traffic info to SD
rodzic
771cdd3997
commit
95c040b8c3
|
@ -386,7 +386,14 @@ static void ProcessRxPacket(OGN_RxPacket<OGN_Packet> *RxPacket, uint8_t RxPacket
|
||||||
{ uint8_t Len=RxPacket->WritePFLAA(Line, Warn, LatDist, LonDist, RxPacket->Packet.DecodeAltitude()-GPS_Altitude/10);
|
{ uint8_t Len=RxPacket->WritePFLAA(Line, Warn, LatDist, LonDist, RxPacket->Packet.DecodeAltitude()-GPS_Altitude/10);
|
||||||
xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
||||||
Format_String(CONS_UART_Write, Line, 0, Len);
|
Format_String(CONS_UART_Write, Line, 0, Len);
|
||||||
xSemaphoreGive(CONS_Mutex); }
|
xSemaphoreGive(CONS_Mutex);
|
||||||
|
#ifdef WITH_SDLOG
|
||||||
|
if(Log_Free()>=128)
|
||||||
|
{ xSemaphoreTake(Log_Mutex, portMAX_DELAY);
|
||||||
|
Format_String(Log_Write, Line, 0, Len); // send the NMEA out to the log file
|
||||||
|
xSemaphoreGive(Log_Mutex); }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_MAVLINK
|
#ifdef WITH_MAVLINK
|
||||||
MAV_ADSB_VEHICLE MAV_RxReport;
|
MAV_ADSB_VEHICLE MAV_RxReport;
|
||||||
|
@ -597,13 +604,27 @@ void vTaskPROC(void* pvParameters)
|
||||||
if(Parameters.Verbose)
|
if(Parameters.Verbose)
|
||||||
{ xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
{ xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
||||||
Look.WritePFLA(CONS_UART_Write); // produce PFLAU and PFLAA for all tracked targets
|
Look.WritePFLA(CONS_UART_Write); // produce PFLAU and PFLAA for all tracked targets
|
||||||
xSemaphoreGive(CONS_Mutex); }
|
xSemaphoreGive(CONS_Mutex);
|
||||||
|
#ifdef WITH_SDLOG
|
||||||
|
if(Log_Free()>=512)
|
||||||
|
{ xSemaphoreTake(Log_Mutex, portMAX_DELAY);
|
||||||
|
Look.WritePFLA(Log_Write);
|
||||||
|
xSemaphoreGive(Log_Mutex); }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if(Parameters.Verbose)
|
if(Parameters.Verbose)
|
||||||
{ uint8_t Len=Look.WritePFLAU(Line); // $PFLAU, overall status
|
{ uint8_t Len=Look.WritePFLAU(Line); // $PFLAU, overall status
|
||||||
xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
||||||
Format_String(CONS_UART_Write, Line, 0, Len);
|
Format_String(CONS_UART_Write, Line, 0, Len);
|
||||||
xSemaphoreGive(CONS_Mutex); }
|
xSemaphoreGive(CONS_Mutex);
|
||||||
|
#ifdef WITH_SDLOG
|
||||||
|
if(Log_Free()>=128)
|
||||||
|
{ xSemaphoreTake(Log_Mutex, portMAX_DELAY);
|
||||||
|
Format_String(Log_Write, Line, 0, Len); // send the NMEA out to the log file
|
||||||
|
xSemaphoreGive(Log_Mutex); }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif // WITH_PFLAA
|
#endif // WITH_PFLAA
|
||||||
uint8_t Warn = 0;
|
uint8_t Warn = 0;
|
||||||
if(Tgt) Warn = Tgt->WarnLevel; // what is the warning level ?
|
if(Tgt) Warn = Tgt->WarnLevel; // what is the warning level ?
|
||||||
|
@ -637,7 +658,14 @@ void vTaskPROC(void* pvParameters)
|
||||||
{ uint8_t Len=Look.WritePFLAU(Line); // $PFLAU, overall status
|
{ uint8_t Len=Look.WritePFLAU(Line); // $PFLAU, overall status
|
||||||
xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
xSemaphoreTake(CONS_Mutex, portMAX_DELAY);
|
||||||
Format_String(CONS_UART_Write, Line, 0, Len);
|
Format_String(CONS_UART_Write, Line, 0, Len);
|
||||||
xSemaphoreGive(CONS_Mutex); }
|
xSemaphoreGive(CONS_Mutex);
|
||||||
|
#ifdef WITH_SDLOG
|
||||||
|
if(Log_Free()>=128)
|
||||||
|
{ xSemaphoreTake(Log_Mutex, portMAX_DELAY);
|
||||||
|
Format_String(Log_Write, Line, 0, Len); // send the NMEA out to the log file
|
||||||
|
xSemaphoreGive(Log_Mutex); }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
#endif // WITH_LOOKOUT
|
#endif // WITH_LOOKOUT
|
||||||
#ifdef WITH_FLASHLOG
|
#ifdef WITH_FLASHLOG
|
||||||
bool Written=FlashLog_Process(PosPacket.Packet, PosTime);
|
bool Written=FlashLog_Process(PosPacket.Packet, PosTime);
|
||||||
|
|
Ładowanie…
Reference in New Issue