SPORT_FILE_LOG renamed to LOG_TELEMETRY. And logs are now stored in telemetry.log
This commit is contained in:
@@ -348,7 +348,7 @@ if(ARCH STREQUAL ARM)
|
|||||||
option(TIMERS "Timers count" 2)
|
option(TIMERS "Timers count" 2)
|
||||||
option(CLI "Command Line Interface" OFF)
|
option(CLI "Command Line Interface" OFF)
|
||||||
option(DEBUG "Debug mode" OFF)
|
option(DEBUG "Debug mode" OFF)
|
||||||
option(SPORT_FILE_LOG "S.PORT Logs on SD card" OFF)
|
option(LOG_TELEMETRY "Telemetry Logs on SD card" OFF)
|
||||||
option(TRACE_SD_CARD "Traces SD enabled" OFF)
|
option(TRACE_SD_CARD "Traces SD enabled" OFF)
|
||||||
option(TRACE_FATFS "Traces FatFS enabled" OFF)
|
option(TRACE_FATFS "Traces FatFS enabled" OFF)
|
||||||
option(TRACE_AUDIO "Traces audio enabled" OFF)
|
option(TRACE_AUDIO "Traces audio enabled" OFF)
|
||||||
@@ -359,8 +359,8 @@ if(ARCH STREQUAL ARM)
|
|||||||
else()
|
else()
|
||||||
add_definitions(-DTIMERS=2)
|
add_definitions(-DTIMERS=2)
|
||||||
endif()
|
endif()
|
||||||
if(SPORT_FILE_LOG)
|
if(LOG_TELEMETRY)
|
||||||
add_definitions(-DSPORT_FILE_LOG)
|
add_definitions(-DLOG_TELEMETRY)
|
||||||
endif()
|
endif()
|
||||||
if(TRACE_SD_CARD)
|
if(TRACE_SD_CARD)
|
||||||
add_definitions(-DTRACE_SD_CARD)
|
add_definitions(-DTRACE_SD_CARD)
|
||||||
|
|||||||
+6
-6
@@ -277,9 +277,9 @@ DEBUG = NO
|
|||||||
# Values = NO, YES
|
# Values = NO, YES
|
||||||
CLI = NO
|
CLI = NO
|
||||||
|
|
||||||
# Activate writing of SPORT telemetry received data to sport.log file
|
# Activate writing of telemetry received data to telemetry.log file
|
||||||
# Values = YES, NO
|
# Values = YES, NO
|
||||||
SPORT_FILE_LOG = NO
|
LOG_TELEMETRY = NO
|
||||||
|
|
||||||
# Timers Count
|
# Timers Count
|
||||||
# Values = 1, 2, 3 (on ARM boards)
|
# Values = 1, 2, 3 (on ARM boards)
|
||||||
@@ -827,8 +827,8 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO AR9X))
|
|||||||
CPPDEFS += -DROTARY_ENCODERS=1
|
CPPDEFS += -DROTARY_ENCODERS=1
|
||||||
CPPSRC += targets/sky9x/rotenc_driver.cpp
|
CPPSRC += targets/sky9x/rotenc_driver.cpp
|
||||||
endif
|
endif
|
||||||
ifeq ($(SPORT_FILE_LOG), YES)
|
ifeq ($(LOG_TELEMETRY), YES)
|
||||||
CPPDEFS += -DSPORT_FILE_LOG
|
CPPDEFS += -DLOG_TELEMETRY
|
||||||
endif
|
endif
|
||||||
INCDIRS += targets/sky9x bitmaps bitmaps/9x $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
INCDIRS += targets/sky9x bitmaps bitmaps/9x $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
||||||
@@ -908,8 +908,8 @@ ifeq ($(PCB), TARANIS)
|
|||||||
FLAVOUR = taranis
|
FLAVOUR = taranis
|
||||||
CPPDEFS = -DREV4
|
CPPDEFS = -DREV4
|
||||||
endif
|
endif
|
||||||
ifeq ($(SPORT_FILE_LOG), YES)
|
ifeq ($(LOG_TELEMETRY), YES)
|
||||||
CPPDEFS += -DSPORT_FILE_LOG
|
CPPDEFS += -DLOG_TELEMETRY
|
||||||
endif
|
endif
|
||||||
ifeq ($(TRACE_SD_CARD), YES)
|
ifeq ($(TRACE_SD_CARD), YES)
|
||||||
DEBUG = YES
|
DEBUG = YES
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ DRESULT disk_ioctl (
|
|||||||
// TODO everything here should not be in the driver layer ...
|
// TODO everything here should not be in the driver layer ...
|
||||||
|
|
||||||
FATFS g_FATFS_Obj;
|
FATFS g_FATFS_Obj;
|
||||||
#if defined(SPORT_FILE_LOG)
|
#if defined(LOG_TELEMETRY)
|
||||||
FIL g_telemetryFile = {0};
|
FIL g_telemetryFile = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -312,8 +312,8 @@ void sdInit(void)
|
|||||||
|
|
||||||
referenceSystemAudioFiles();
|
referenceSystemAudioFiles();
|
||||||
|
|
||||||
#if defined(SPORT_FILE_LOG)
|
#if defined(LOG_TELEMETRY)
|
||||||
f_open(&g_telemetryFile, LOGS_PATH "/sport.log", FA_OPEN_ALWAYS | FA_WRITE);
|
f_open(&g_telemetryFile, LOGS_PATH "/telemetry.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||||
if (f_size(&g_telemetryFile) > 0) {
|
if (f_size(&g_telemetryFile) > 0) {
|
||||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||||
}
|
}
|
||||||
@@ -328,7 +328,7 @@ void sdDone()
|
|||||||
{
|
{
|
||||||
if (sdMounted()) {
|
if (sdMounted()) {
|
||||||
audioQueue.stopSD();
|
audioQueue.stopSD();
|
||||||
#if defined(SPORT_FILE_LOG)
|
#if defined(LOG_TELEMETRY)
|
||||||
f_close(&g_telemetryFile);
|
f_close(&g_telemetryFile);
|
||||||
#endif
|
#endif
|
||||||
f_mount(NULL, "", 0); // unmount SD
|
f_mount(NULL, "", 0); // unmount SD
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) OpenTX
|
* Copyright (C) OpenTX
|
||||||
*
|
*
|
||||||
* Based on code named
|
* Based on code named
|
||||||
* th9x - http://code.google.com/p/th9x
|
* th9x - http://code.google.com/p/th9x
|
||||||
* er9x - http://code.google.com/p/er9x
|
* er9x - http://code.google.com/p/er9x
|
||||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||||
*
|
*
|
||||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../opentx.h"
|
#include "../../opentx.h"
|
||||||
#include "../../thirdparty/FatFs/diskio.h"
|
#include "../../thirdparty/FatFs/diskio.h"
|
||||||
#include "../../thirdparty/FatFs/ff.h"
|
#include "../../thirdparty/FatFs/ff.h"
|
||||||
@@ -938,7 +938,7 @@ void sdPoll10ms()
|
|||||||
// TODO everything here should not be in the driver layer ...
|
// TODO everything here should not be in the driver layer ...
|
||||||
|
|
||||||
FATFS g_FATFS_Obj;
|
FATFS g_FATFS_Obj;
|
||||||
#if defined(SPORT_FILE_LOG)
|
#if defined(LOG_TELEMETRY)
|
||||||
FIL g_telemetryFile = {0};
|
FIL g_telemetryFile = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -965,8 +965,8 @@ void sdInit(void)
|
|||||||
|
|
||||||
referenceSystemAudioFiles();
|
referenceSystemAudioFiles();
|
||||||
|
|
||||||
#if defined(SPORT_FILE_LOG)
|
#if defined(LOG_TELEMETRY)
|
||||||
f_open(&g_telemetryFile, LOGS_PATH "/sport.log", FA_OPEN_ALWAYS | FA_WRITE);
|
f_open(&g_telemetryFile, LOGS_PATH "/telemetry.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||||
if (f_size(&g_telemetryFile) > 0) {
|
if (f_size(&g_telemetryFile) > 0) {
|
||||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||||
}
|
}
|
||||||
@@ -978,7 +978,7 @@ void sdDone()
|
|||||||
{
|
{
|
||||||
if (sdMounted()) {
|
if (sdMounted()) {
|
||||||
audioQueue.stopSD();
|
audioQueue.stopSD();
|
||||||
#if defined(SPORT_FILE_LOG)
|
#if defined(LOG_TELEMETRY)
|
||||||
f_close(&g_telemetryFile);
|
f_close(&g_telemetryFile);
|
||||||
#endif
|
#endif
|
||||||
f_mount(NULL, "", 0); // unmount SD
|
f_mount(NULL, "", 0); // unmount SD
|
||||||
|
|||||||
@@ -152,22 +152,22 @@ NOINLINE void processSerialData(uint8_t data)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
if (g_eeGeneral.serial2Mode == UART_MODE_TELEMETRY_MIRROR) {
|
if (g_eeGeneral.serial2Mode == UART_MODE_TELEMETRY_MIRROR) {
|
||||||
serial2Putc(data);
|
serial2Putc(data);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS) && defined(REV9E) && !defined(SIMU)
|
#if defined(PCBTARANIS) && defined(REV9E) && !defined(SIMU)
|
||||||
#define BLUETOOTH_BUFFER_LENGTH 20
|
#define BLUETOOTH_BUFFER_LENGTH 20
|
||||||
static uint8_t bluetoothBuffer[BLUETOOTH_BUFFER_LENGTH];
|
static uint8_t bluetoothBuffer[BLUETOOTH_BUFFER_LENGTH];
|
||||||
static uint8_t bluetoothIndex = 0;
|
static uint8_t bluetoothIndex = 0;
|
||||||
bluetoothBuffer[bluetoothIndex++] = data;
|
bluetoothBuffer[bluetoothIndex++] = data;
|
||||||
if (bluetoothIndex == BLUETOOTH_BUFFER_LENGTH) {
|
if (bluetoothIndex == BLUETOOTH_BUFFER_LENGTH) {
|
||||||
if (bluetoothReady()) {
|
if (bluetoothReady()) {
|
||||||
bluetoothWrite(bluetoothBuffer, BLUETOOTH_BUFFER_LENGTH);
|
bluetoothWrite(bluetoothBuffer, BLUETOOTH_BUFFER_LENGTH);
|
||||||
}
|
|
||||||
bluetoothIndex = 0;
|
|
||||||
}
|
}
|
||||||
|
bluetoothIndex = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (dataState)
|
switch (dataState)
|
||||||
@@ -284,7 +284,7 @@ void telemetryWakeup()
|
|||||||
|
|
||||||
#if defined(CPUSTM32)
|
#if defined(CPUSTM32)
|
||||||
uint8_t data;
|
uint8_t data;
|
||||||
#if defined(SPORT_FILE_LOG) && !defined(SIMU)
|
#if defined(LOG_TELEMETRY) && !defined(SIMU)
|
||||||
static tmr10ms_t lastTime = 0;
|
static tmr10ms_t lastTime = 0;
|
||||||
tmr10ms_t newTime = get_tmr10ms();
|
tmr10ms_t newTime = get_tmr10ms();
|
||||||
struct gtm utm;
|
struct gtm utm;
|
||||||
@@ -292,7 +292,7 @@ void telemetryWakeup()
|
|||||||
#endif
|
#endif
|
||||||
while (telemetryFifo.pop(data)) {
|
while (telemetryFifo.pop(data)) {
|
||||||
processSerialData(data);
|
processSerialData(data);
|
||||||
#if defined(SPORT_FILE_LOG) && !defined(SIMU)
|
#if defined(LOG_TELEMETRY) && !defined(SIMU)
|
||||||
extern FIL g_telemetryFile;
|
extern FIL g_telemetryFile;
|
||||||
if (lastTime != newTime) {
|
if (lastTime != newTime) {
|
||||||
f_printf(&g_telemetryFile, "\r\n%4d-%02d-%02d,%02d:%02d:%02d.%02d0: %02X", utm.tm_year+1900, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec, g_ms100, data);
|
f_printf(&g_telemetryFile, "\r\n%4d-%02d-%02d,%02d:%02d:%02d.%02d0: %02X", utm.tm_year+1900, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec, g_ms100, data);
|
||||||
|
|||||||
Reference in New Issue
Block a user