1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

initialized log packages with 0xff instead of 0x0 to reduce flash wear

This commit is contained in:
Corvus Corax 2013-11-24 15:36:26 +01:00
parent 32b5ff22cf
commit 89afbde58a
2 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ void PIOS_DEBUGLOG_UAVObject(uint32_t objid, uint16_t instid, size_t size, uint8
size = sizeof(buffer->Data);
}
buffer->Size = size;
memset(buffer->Data, 0, sizeof(buffer->Data));
memset(buffer->Data, 0xff, sizeof(buffer->Data));
memcpy(buffer->Data, data, size);
if (PIOS_FLASHFS_ObjSave(pios_user_fs_id, flightnum * 256, lognum, (uint8_t *)buffer, sizeof(DebugLogEntryData)) == 0) {
@ -142,7 +142,7 @@ void PIOS_DEBUGLOG_Printf(char *format, ...)
va_list args;
va_start(args, format);
mutexlock();
memset(buffer->Data, 0, sizeof(buffer->Data));
memset(buffer->Data, 0xff, sizeof(buffer->Data));
vsnprintf((char *)buffer->Data, sizeof(buffer->Data), (char *)format, args);
buffer->Flight = flightnum;
#if defined(PIOS_INCLUDE_FREERTOS)

View File

@ -120,7 +120,7 @@ void PIOS_DEBUGLOG_UAVObject(uint32_t objid, uint16_t instid, size_t size, uint8
size = sizeof(buffer->Data);
}
buffer->Size = size;
memset(buffer->Data, 0, sizeof(buffer->Data));
memset(buffer->Data, 0xff, sizeof(buffer->Data));
memcpy(buffer->Data, data, size);
if (PIOS_FLASHFS_ObjSave(pios_user_fs_id, flightnum * 256, lognum, (uint8_t *)buffer, sizeof(DebugLogEntryData)) == 0) {
@ -142,7 +142,7 @@ void PIOS_DEBUGLOG_Printf(char *format, ...)
va_list args;
va_start(args, format);
mutexlock();
memset(buffer->Data, 0, sizeof(buffer->Data));
memset(buffer->Data, 0xff, sizeof(buffer->Data));
vsnprintf((char *)buffer->Data, sizeof(buffer->Data), (char *)format, args);
buffer->Flight = flightnum;
#if defined(PIOS_INCLUDE_FREERTOS)