From f26cf6a3ecb6b321f8ffdb8f144f5c169b28c0c0 Mon Sep 17 00:00:00 2001 From: "Igor B. Poretsky" Date: Fri, 14 Aug 2015 18:11:49 +0300 Subject: [PATCH] Fixed system state information loss when it is saved in file Change-Id: If2aca712af4152e144ec919cfc4b4d9cb23bf4f2 --- apps/settings.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/settings.c b/apps/settings.c index 2d38c4a5ef..2841133957 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -89,7 +89,12 @@ struct system_status global_status; #include "pcm_sampr.h" #endif /* CONFIG_CODEC == SWCODEC */ +#define NVRAM_DATA_START 8 +#ifdef HAVE_RTC_RAM #define NVRAM_BLOCK_SIZE 44 +#else +#define NVRAM_BLOCK_SIZE (sizeof(struct system_status) + NVRAM_DATA_START) +#endif #ifdef HAVE_LCD_BITMAP #define MAX_LINES 10 @@ -118,7 +123,6 @@ long lasttime = 0; [4-7] crc32 checksum [8-NVRAM_BLOCK_SIZE] data */ -#define NVRAM_DATA_START 8 static char nvram_buffer[NVRAM_BLOCK_SIZE]; static bool read_nvram_data(char* buf, int max_len)