summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorIgor B. Poretsky <poretsky@mlbox.ru>2015-08-14 18:11:49 +0300
committerSolomon Peachy <pizza@shaftnet.org>2020-06-30 14:20:37 +0000
commitf26cf6a3ecb6b321f8ffdb8f144f5c169b28c0c0 (patch)
tree7dbdb97cddada6a37e20642478f979bd796f5eca /apps
parent553f2180267ea869a364c929ac2cf1bfc98b6585 (diff)
downloadrockbox-f26cf6a3ecb6b321f8ffdb8f144f5c169b28c0c0.tar.gz
rockbox-f26cf6a3ecb6b321f8ffdb8f144f5c169b28c0c0.zip
Fixed system state information loss when it is saved in file
Change-Id: If2aca712af4152e144ec919cfc4b4d9cb23bf4f2
Diffstat (limited to 'apps')
-rw-r--r--apps/settings.c6
1 files changed, 5 insertions, 1 deletions
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)