mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 09:16:07 +03:00
Changed suffix for file detection as well.
This commit is contained in:
parent
7ed2dc6fe3
commit
7195f1dd2e
1 changed files with 7 additions and 5 deletions
|
@ -96,6 +96,9 @@ static struct {
|
|||
} state;
|
||||
} blackboxSDCard;
|
||||
|
||||
#define LOGFILE_PREFIX "LOG"
|
||||
#define LOGFILE_SUFFIX ".BFL"
|
||||
|
||||
#endif
|
||||
|
||||
void blackboxWrite(uint8_t value)
|
||||
|
@ -692,7 +695,7 @@ static void blackboxCreateLogFile()
|
|||
{
|
||||
uint32_t remainder = blackboxSDCard.largestLogFileNumber + 1;
|
||||
|
||||
char *filename = "log00000.bfl";
|
||||
char *filename = LOGFILE_PREFIX "00000" LOGFILE_SUFFIX;
|
||||
|
||||
for (int i = 7; i >= 3; i--) {
|
||||
filename[i] = (remainder % 10) + '0';
|
||||
|
@ -731,10 +734,9 @@ static bool blackboxSDCardBeginLog()
|
|||
while (afatfs_findNext(blackboxSDCard.logDirectory, &blackboxSDCard.logDirectoryFinder, &directoryEntry) == AFATFS_OPERATION_SUCCESS) {
|
||||
if (directoryEntry && !fat_isDirectoryEntryTerminator(directoryEntry)) {
|
||||
// If this is a log file, parse the log number from the filename
|
||||
if (
|
||||
directoryEntry->filename[0] == 'L' && directoryEntry->filename[1] == 'O' && directoryEntry->filename[2] == 'G'
|
||||
&& directoryEntry->filename[8] == 'T' && directoryEntry->filename[9] == 'X' && directoryEntry->filename[10] == 'T'
|
||||
) {
|
||||
if (strncmp(directoryEntry->filename, LOGFILE_PREFIX, strlen(LOGFILE_PREFIX))
|
||||
&& strncmp(directoryEntry->filename + 8, LOGFILE_SUFFIX, strlen(LOGFILE_SUFFIX))
|
||||
&& strlen(directoryEntry->filename) == 12) {
|
||||
char logSequenceNumberString[6];
|
||||
|
||||
memcpy(logSequenceNumberString, directoryEntry->filename + 3, 5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue