/trunk/logging.c |
---|
67,6 → 67,7 |
#define MIN_SD_INTERVAL_KML 200 |
#define MIN_SD_INTERVAL_GPX 500 |
#define APPEND_LOG_TIME_MS 5000 // log some more time |
u8 SD_LoggingError = 0; |
151,6 → 152,8 |
static s8* logfilename = NULL; // the pointer to the logfilename |
static u32 logtimer = 0, flushtimer = 0; // the log update timer |
static KML_Document_t logfile; // the logfilehandle |
static u32 appendtimer = 0; // the log update timer |
static u8 logging_active = 0; |
// initialize if LogDelay is zero |
if(!LogDelay) |
176,6 → 179,16 |
if(FC.StatusFlags & FC_STATUS_MOTOR_RUN) |
{ |
logging_active = 1; |
appendtimer = SetDelay(APPEND_LOG_TIME_MS); |
} |
else |
{ |
if(CheckDelay(appendtimer)) logging_active = 0; |
} |
if(logging_active) |
{ |
switch(logfilestate) |
{ |
case LOGFILE_IDLE: |
281,9 → 294,9 |
{ |
static logfilestate_t logfilestate = LOGFILE_IDLE; // the current logfilestate |
static s8* logfilename = NULL; // the pointer to the logfilename |
static u32 logtimer = 0, flushtimer = 0; // the log update timer |
static u32 logtimer = 0, flushtimer = 0, appendtimer = 0; // the log update timer |
static GPX_Document_t logfile; // the logfilehandle |
static u8 part = 0; |
static u8 part = 0, logging_active = 0; |
u32 measure_time; |
// initialize if LogDelay is zero |
308,8 → 321,18 |
{ |
if(!part) logtimer = SetDelay(LogDelay); // standard interval |
if(FC.StatusFlags & FC_STATUS_MOTOR_RUN || part) |
if(FC.StatusFlags & FC_STATUS_MOTOR_RUN) |
{ |
logging_active = 1; |
appendtimer = SetDelay(APPEND_LOG_TIME_MS); |
} |
else |
{ |
if(CheckDelay(appendtimer)) logging_active = 0; |
} |
if(logging_active || part) |
{ |
switch(logfilestate) |
{ |
case LOGFILE_IDLE: |
/trunk/main.c |
---|
333,7 → 333,7 |
newErrorCode = 23; |
DebugOut.StatusRed |= AMPEL_BL; |
} |
else if(BL_MinOfMaxPWM != 255 && (FC.StatusFlags & FC_STATUS_FLY) && !ErrorCode) |
else if(BL_MinOfMaxPWM != 255 && (BL_MinOfMaxPWM != 250) && (FC.StatusFlags & FC_STATUS_FLY) && !ErrorCode) |
{ |
LED_RED_ON; |
sprintf(ErrorMSG,"ERR:BL Limitation "); |
554,7 → 554,7 |
if(!SD_WatchDog) UART1_PutString("\n\rSD-Watchdog - Logging aborted\n\r"); |
} |
/* |
if(CheckDelay(ftimer)) |
{ |
600,7 → 600,7 |
break; |
} |
} |
*/ |
} |
} |
/trunk/main.h |
---|
14,7 → 14,7 |
#define VERSION_MAJOR 0 |
#define VERSION_MINOR 29 |
#define VERSION_PATCH 1 |
#define VERSION_PATCH 3 |
// 0 = A |
// 1 = B |
// 2 = C |
/trunk/mkprotocol.c |
---|
59,6 → 59,7 |
#include "ramfunc.h" |
#include "usb.h" |
#include "uart1.h" |
#include "main.h" |
/**************************************************************/ |
/* Create serial output frame */ |
191,7 → 192,7 |
pRxBuff->Position = 0; |
pRxBuff->Locked = TRUE; // lock the rxd buffer |
// if 2nd byte is an 'R' start bootloader |
if(pRxBuff->pData[2] == 'R') |
if(pRxBuff->pData[2] == 'R' && !(FC.StatusFlags & FC_STATUS_MOTOR_RUN)) // not if the motors are running) |
{ |
PowerOff(); |
VIC_DeInit(); |
/trunk/spi_slave.c |
---|
695,7 → 695,7 |
*/ |
//+++++++++++++++++++++++++++++++++++++++++++++++++++ |
// in SPI Einkommentieren, falls der Flug simultert werden soll |
/* |
if(Parameter.User8 < 100) FC.StatusFlags = 0; |
else |
if(Parameter.User8 < 150) FC.StatusFlags = FC_STATUS_START; |
702,7 → 702,7 |
else FC.StatusFlags = FC_STATUS_FLY | FC_STATUS_MOTOR_RUN; |
BL_MinOfMaxPWM = 255; |
NaviData.FCStatusFlags = FC.StatusFlags; |
*/ |
//+++++++++++++++++++++++++++++++++++++++++++++++++++ |
/trunk/uart1.c |
---|
405,8 → 405,8 |
{ |
case 'f': // ftp command |
if(FC.StatusFlags & FC_STATUS_MOTOR_RUN) break; // not if the motors are running |
UART1_Request_FTP = SerialMsg.pData[0]; |
//if (UART1_Request_FTP == FTP_CMD_SET_CWD || UART1_Request_FTP == FTP_CMD_GET_FILE) |
memcpy(&FTP_data, &SerialMsg.pData[1], sizeof(FTP_data)); // copy ftp parameter |
break; |