SPORT_FILE_LOG renamed to LOG_TELEMETRY. And logs are now stored in telemetry.log

This commit is contained in:
Bertrand Songis
2016-01-30 12:58:00 +01:00
parent 3913a36aeb
commit c36acc5372
5 changed files with 51 additions and 51 deletions
+3 -3
View File
@@ -348,7 +348,7 @@ if(ARCH STREQUAL ARM)
option(TIMERS "Timers count" 2)
option(CLI "Command Line Interface" 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_FATFS "Traces FatFS enabled" OFF)
option(TRACE_AUDIO "Traces audio enabled" OFF)
@@ -359,8 +359,8 @@ if(ARCH STREQUAL ARM)
else()
add_definitions(-DTIMERS=2)
endif()
if(SPORT_FILE_LOG)
add_definitions(-DSPORT_FILE_LOG)
if(LOG_TELEMETRY)
add_definitions(-DLOG_TELEMETRY)
endif()
if(TRACE_SD_CARD)
add_definitions(-DTRACE_SD_CARD)
+6 -6
View File
@@ -277,9 +277,9 @@ DEBUG = NO
# Values = NO, YES
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
SPORT_FILE_LOG = NO
LOG_TELEMETRY = NO
# Timers Count
# Values = 1, 2, 3 (on ARM boards)
@@ -827,8 +827,8 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO AR9X))
CPPDEFS += -DROTARY_ENCODERS=1
CPPSRC += targets/sky9x/rotenc_driver.cpp
endif
ifeq ($(SPORT_FILE_LOG), YES)
CPPDEFS += -DSPORT_FILE_LOG
ifeq ($(LOG_TELEMETRY), YES)
CPPDEFS += -DLOG_TELEMETRY
endif
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
@@ -908,8 +908,8 @@ ifeq ($(PCB), TARANIS)
FLAVOUR = taranis
CPPDEFS = -DREV4
endif
ifeq ($(SPORT_FILE_LOG), YES)
CPPDEFS += -DSPORT_FILE_LOG
ifeq ($(LOG_TELEMETRY), YES)
CPPDEFS += -DLOG_TELEMETRY
endif
ifeq ($(TRACE_SD_CARD), YES)
DEBUG = YES
+4 -4
View File
@@ -294,7 +294,7 @@ DRESULT disk_ioctl (
// TODO everything here should not be in the driver layer ...
FATFS g_FATFS_Obj;
#if defined(SPORT_FILE_LOG)
#if defined(LOG_TELEMETRY)
FIL g_telemetryFile = {0};
#endif
@@ -312,8 +312,8 @@ void sdInit(void)
referenceSystemAudioFiles();
#if defined(SPORT_FILE_LOG)
f_open(&g_telemetryFile, LOGS_PATH "/sport.log", FA_OPEN_ALWAYS | FA_WRITE);
#if defined(LOG_TELEMETRY)
f_open(&g_telemetryFile, LOGS_PATH "/telemetry.log", FA_OPEN_ALWAYS | FA_WRITE);
if (f_size(&g_telemetryFile) > 0) {
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
}
@@ -328,7 +328,7 @@ void sdDone()
{
if (sdMounted()) {
audioQueue.stopSD();
#if defined(SPORT_FILE_LOG)
#if defined(LOG_TELEMETRY)
f_close(&g_telemetryFile);
#endif
f_mount(NULL, "", 0); // unmount SD
+24 -24
View File
@@ -1,23 +1,23 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* 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
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* 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
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#include "../../thirdparty/FatFs/diskio.h"
#include "../../thirdparty/FatFs/ff.h"
@@ -938,7 +938,7 @@ void sdPoll10ms()
// TODO everything here should not be in the driver layer ...
FATFS g_FATFS_Obj;
#if defined(SPORT_FILE_LOG)
#if defined(LOG_TELEMETRY)
FIL g_telemetryFile = {0};
#endif
@@ -965,8 +965,8 @@ void sdInit(void)
referenceSystemAudioFiles();
#if defined(SPORT_FILE_LOG)
f_open(&g_telemetryFile, LOGS_PATH "/sport.log", FA_OPEN_ALWAYS | FA_WRITE);
#if defined(LOG_TELEMETRY)
f_open(&g_telemetryFile, LOGS_PATH "/telemetry.log", FA_OPEN_ALWAYS | FA_WRITE);
if (f_size(&g_telemetryFile) > 0) {
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
}
@@ -978,7 +978,7 @@ void sdDone()
{
if (sdMounted()) {
audioQueue.stopSD();
#if defined(SPORT_FILE_LOG)
#if defined(LOG_TELEMETRY)
f_close(&g_telemetryFile);
#endif
f_mount(NULL, "", 0); // unmount SD
+14 -14
View File
@@ -152,22 +152,22 @@ NOINLINE void processSerialData(uint8_t data)
#endif
#if defined(PCBTARANIS)
if (g_eeGeneral.serial2Mode == UART_MODE_TELEMETRY_MIRROR) {
serial2Putc(data);
}
if (g_eeGeneral.serial2Mode == UART_MODE_TELEMETRY_MIRROR) {
serial2Putc(data);
}
#endif
#if defined(PCBTARANIS) && defined(REV9E) && !defined(SIMU)
#define BLUETOOTH_BUFFER_LENGTH 20
static uint8_t bluetoothBuffer[BLUETOOTH_BUFFER_LENGTH];
static uint8_t bluetoothIndex = 0;
bluetoothBuffer[bluetoothIndex++] = data;
if (bluetoothIndex == BLUETOOTH_BUFFER_LENGTH) {
if (bluetoothReady()) {
bluetoothWrite(bluetoothBuffer, BLUETOOTH_BUFFER_LENGTH);
}
bluetoothIndex = 0;
#define BLUETOOTH_BUFFER_LENGTH 20
static uint8_t bluetoothBuffer[BLUETOOTH_BUFFER_LENGTH];
static uint8_t bluetoothIndex = 0;
bluetoothBuffer[bluetoothIndex++] = data;
if (bluetoothIndex == BLUETOOTH_BUFFER_LENGTH) {
if (bluetoothReady()) {
bluetoothWrite(bluetoothBuffer, BLUETOOTH_BUFFER_LENGTH);
}
bluetoothIndex = 0;
}
#endif
switch (dataState)
@@ -284,7 +284,7 @@ void telemetryWakeup()
#if defined(CPUSTM32)
uint8_t data;
#if defined(SPORT_FILE_LOG) && !defined(SIMU)
#if defined(LOG_TELEMETRY) && !defined(SIMU)
static tmr10ms_t lastTime = 0;
tmr10ms_t newTime = get_tmr10ms();
struct gtm utm;
@@ -292,7 +292,7 @@ void telemetryWakeup()
#endif
while (telemetryFifo.pop(data)) {
processSerialData(data);
#if defined(SPORT_FILE_LOG) && !defined(SIMU)
#if defined(LOG_TELEMETRY) && !defined(SIMU)
extern FIL g_telemetryFile;
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);