Drop HAVE_RTC_RAM
Only Archos players ever used this feature and it isn't implemented on any current targets. Change-Id: I39c8455480a3fe33cd25b667e8d4d6ff3a092d3e
This commit is contained in:
parent
de578bde1f
commit
5a4cc8da3f
|
@ -584,7 +584,7 @@ void wps_do_playpause(bool updatewps)
|
|||
state->paused = true;
|
||||
pause_action(true, updatewps);
|
||||
settings_save();
|
||||
#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
|
||||
#if !defined(HAVE_SW_POWEROFF)
|
||||
call_storage_idle_notifys(true); /* make sure resume info is saved */
|
||||
#endif
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ long gui_wps_show(void)
|
|||
about to shut down. lets save the settings. */
|
||||
if (state->paused) {
|
||||
settings_save();
|
||||
#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
|
||||
#if !defined(HAVE_SW_POWEROFF)
|
||||
call_storage_idle_notifys(true);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -444,11 +444,6 @@ static void init(void)
|
|||
#if CONFIG_RTC
|
||||
rtc_init();
|
||||
#endif
|
||||
#ifdef HAVE_RTC_RAM
|
||||
CHART(">settings_load(RTC)");
|
||||
settings_load(SETTINGS_RTC); /* early load parts of global_settings */
|
||||
CHART("<settings_load(RTC)");
|
||||
#endif
|
||||
|
||||
adc_init();
|
||||
|
||||
|
|
|
@ -83,11 +83,7 @@ struct system_status global_status;
|
|||
#include "pcm_sampr.h"
|
||||
|
||||
#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
|
||||
|
||||
#define MAX_LINES 10
|
||||
|
||||
|
@ -118,7 +114,6 @@ static bool read_nvram_data(char* buf, int max_len)
|
|||
{
|
||||
unsigned crc32 = 0xffffffff;
|
||||
int var_count = 0, i = 0, buf_pos = 0;
|
||||
#ifndef HAVE_RTC_RAM
|
||||
int fd = open(NVRAM_FILE, O_RDONLY);
|
||||
int bytes;
|
||||
if (fd < 0)
|
||||
|
@ -128,12 +123,6 @@ static bool read_nvram_data(char* buf, int max_len)
|
|||
close(fd);
|
||||
if (bytes < 8) /* min is 8 bytes,magic, ver, vars, crc32 */
|
||||
return false;
|
||||
#else
|
||||
memset(buf,0,max_len);
|
||||
/* read rtc block */
|
||||
for (i=0; i < max_len; i++ )
|
||||
buf[i] = rtc_read(0x14+i);
|
||||
#endif
|
||||
/* check magic, version */
|
||||
if ((buf[0] != 'R') || (buf[1] != 'b')
|
||||
|| (buf[2] != NVRAM_CONFIG_VERSION))
|
||||
|
@ -171,9 +160,7 @@ static bool write_nvram_data(char* buf, int max_len)
|
|||
unsigned crc32 = 0xffffffff;
|
||||
int i = 0, buf_pos = 0;
|
||||
char var_count = 0;
|
||||
#ifndef HAVE_RTC_RAM
|
||||
int fd;
|
||||
#endif
|
||||
memset(buf,0,max_len);
|
||||
/* magic, version */
|
||||
buf[0] = 'R'; buf[1] = 'b';
|
||||
|
@ -195,7 +182,6 @@ static bool write_nvram_data(char* buf, int max_len)
|
|||
crc32 = crc_32(&buf[NVRAM_DATA_START],
|
||||
max_len-NVRAM_DATA_START-1,0xffffffff);
|
||||
memcpy(&buf[4],&crc32,4);
|
||||
#ifndef HAVE_RTC_RAM
|
||||
fd = open(NVRAM_FILE,O_CREAT|O_TRUNC|O_WRONLY, 0666);
|
||||
if (fd >= 0)
|
||||
{
|
||||
|
@ -204,16 +190,6 @@ static bool write_nvram_data(char* buf, int max_len)
|
|||
if (len < 8)
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
/* FIXME: okay, it _would_ be cleaner and faster to implement rtc_write so
|
||||
that it would write a number of bytes at a time since the RTC chip
|
||||
supports that, but this will have to do for now 8-) */
|
||||
for (i=0; i < NVRAM_BLOCK_SIZE; i++ ) {
|
||||
int r = rtc_write(0x14+i, buf[i]);
|
||||
if (r)
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -586,12 +562,12 @@ static bool settings_write_config(const char* filename, int options)
|
|||
close(fd);
|
||||
return true;
|
||||
}
|
||||
#ifndef HAVE_RTC_RAM
|
||||
|
||||
static void flush_global_status_callback(void)
|
||||
{
|
||||
write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void flush_config_block_callback(void)
|
||||
{
|
||||
write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
|
||||
|
@ -621,23 +597,12 @@ static void update_runtime(void)
|
|||
void status_save(void)
|
||||
{
|
||||
update_runtime();
|
||||
#ifdef HAVE_RTC_RAM
|
||||
/* this will be done in the storage_callback if
|
||||
target doesnt have rtc ram */
|
||||
write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
|
||||
#else
|
||||
register_storage_idle_func(flush_global_status_callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
int settings_save(void)
|
||||
{
|
||||
update_runtime();
|
||||
#ifdef HAVE_RTC_RAM
|
||||
/* this will be done in the storage_callback if
|
||||
target doesnt have rtc ram */
|
||||
write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
|
||||
#endif
|
||||
register_storage_idle_func(flush_config_block_callback);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -51,9 +51,6 @@
|
|||
#define HAVE_TOUCHSCREEN
|
||||
#define HAVE_BUTTON_DATA
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC APPLICATION
|
||||
|
||||
|
|
|
@ -90,9 +90,6 @@
|
|||
/* The D2 has either a PCF50606 or PCF50635, RTC_D2 handles both */
|
||||
#define CONFIG_RTC RTC_D2
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* Define this if you have a software controlled poweroff */
|
||||
#define HAVE_SW_POWEROFF
|
||||
|
||||
|
|
|
@ -43,9 +43,6 @@
|
|||
#define HAVE_TOUCHSCREEN
|
||||
#define HAVE_BUTTON_DATA
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC APPLICATION
|
||||
|
||||
|
|
|
@ -42,9 +42,6 @@
|
|||
#define HAVE_TOUCHSCREEN
|
||||
#define HAVE_BUTTON_DATA
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC APPLICATION
|
||||
|
||||
|
|
|
@ -43,9 +43,6 @@
|
|||
#define HAVE_TOUCHSCREEN
|
||||
#define HAVE_BUTTON_DATA
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC APPLICATION
|
||||
|
||||
|
|
|
@ -68,10 +68,6 @@
|
|||
/* TODO: ASCODEC has an auto dim feature, so disabling the supply to leds should do the trick. But for now I tested SW fading only */
|
||||
#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
/* TODO: in theory we could use that, ascodec offers us such a ram. we have also a small device, part of the nand of 1 MB size, that Samsung uses to store region code etc and it's almost unused space */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC RTC_AS3514
|
||||
#define HAVE_RTC_ALARM
|
||||
|
|
|
@ -75,9 +75,6 @@
|
|||
#define CONFIG_RTC RTC_AS3514
|
||||
#endif
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* Define this if you have a software controlled poweroff */
|
||||
#define HAVE_SW_POWEROFF
|
||||
|
||||
|
|
|
@ -52,9 +52,6 @@
|
|||
#define HAVE_TOUCHSCREEN
|
||||
#define HAVE_BUTTON_DATA
|
||||
|
||||
/* define this if you have RTC RAM available for settings */
|
||||
//#define HAVE_RTC_RAM
|
||||
|
||||
/* define this if you have a real-time clock */
|
||||
#define CONFIG_RTC APPLICATION
|
||||
|
||||
|
|
Loading…
Reference in New Issue