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:
parent
32b5ff22cf
commit
89afbde58a
@ -120,7 +120,7 @@ void PIOS_DEBUGLOG_UAVObject(uint32_t objid, uint16_t instid, size_t size, uint8
|
|||||||
size = sizeof(buffer->Data);
|
size = sizeof(buffer->Data);
|
||||||
}
|
}
|
||||||
buffer->Size = size;
|
buffer->Size = size;
|
||||||
memset(buffer->Data, 0, sizeof(buffer->Data));
|
memset(buffer->Data, 0xff, sizeof(buffer->Data));
|
||||||
memcpy(buffer->Data, data, size);
|
memcpy(buffer->Data, data, size);
|
||||||
|
|
||||||
if (PIOS_FLASHFS_ObjSave(pios_user_fs_id, flightnum * 256, lognum, (uint8_t *)buffer, sizeof(DebugLogEntryData)) == 0) {
|
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_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
mutexlock();
|
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);
|
vsnprintf((char *)buffer->Data, sizeof(buffer->Data), (char *)format, args);
|
||||||
buffer->Flight = flightnum;
|
buffer->Flight = flightnum;
|
||||||
#if defined(PIOS_INCLUDE_FREERTOS)
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
||||||
|
@ -120,7 +120,7 @@ void PIOS_DEBUGLOG_UAVObject(uint32_t objid, uint16_t instid, size_t size, uint8
|
|||||||
size = sizeof(buffer->Data);
|
size = sizeof(buffer->Data);
|
||||||
}
|
}
|
||||||
buffer->Size = size;
|
buffer->Size = size;
|
||||||
memset(buffer->Data, 0, sizeof(buffer->Data));
|
memset(buffer->Data, 0xff, sizeof(buffer->Data));
|
||||||
memcpy(buffer->Data, data, size);
|
memcpy(buffer->Data, data, size);
|
||||||
|
|
||||||
if (PIOS_FLASHFS_ObjSave(pios_user_fs_id, flightnum * 256, lognum, (uint8_t *)buffer, sizeof(DebugLogEntryData)) == 0) {
|
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_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
mutexlock();
|
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);
|
vsnprintf((char *)buffer->Data, sizeof(buffer->Data), (char *)format, args);
|
||||||
buffer->Flight = flightnum;
|
buffer->Flight = flightnum;
|
||||||
#if defined(PIOS_INCLUDE_FREERTOS)
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
||||||
|
Loading…
Reference in New Issue
Block a user