From 5d849a963e562d1996c20cd72228835276288141 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Wed, 2 Feb 2011 17:43:32 +0000 Subject: Clean up multiple definitions of RAM size. Remove -DMEM (make) and MEM (code), use the already defined MEMORYSIZE instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29189 a1c6a512-1295-4272-9138-f99709370657 --- apps/buffering.c | 6 +++--- apps/codecs.h | 4 ---- apps/main.c | 2 +- apps/mpeg.c | 4 ++-- apps/plugin.h | 4 ---- apps/plugins/rockboy/rockboy.c | 2 +- apps/plugins/wavplay.c | 2 +- apps/recorder/pcm_record.c | 8 ++++---- apps/settings_list.c | 4 ++-- apps/talk.c | 2 +- 10 files changed, 15 insertions(+), 23 deletions(-) (limited to 'apps') diff --git a/apps/buffering.c b/apps/buffering.c index 46b6455178..8d41324190 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -119,7 +119,7 @@ static volatile size_t buf_ridx; /* current reading position */ /* Configuration */ static size_t conf_watermark = 0; /* Level to trigger filebuf fill */ -#if MEM > 8 +#if MEMORYSIZE > 8 static size_t high_watermark = 0; /* High watermark for rebuffer */ #endif @@ -1509,7 +1509,7 @@ void buffering_thread(void) #if 0 /* TODO: This needs to be fixed to use the idle callback, disable it * for simplicity until its done right */ -#if MEM > 8 +#if MEMORYSIZE > 8 /* If the disk is spinning, take advantage by filling the buffer */ else if (storage_disk_is_active() && queue_empty(&buffering_queue)) { @@ -1589,7 +1589,7 @@ bool buffering_reset(char *buf, size_t buflen) base_handle_id = -1; /* Set the high watermark as 75% full...or 25% empty :) */ -#if MEM > 8 +#if MEMORYSIZE > 8 high_watermark = 3*buflen / 4; #endif diff --git a/apps/codecs.h b/apps/codecs.h index 1c0b9da6ba..c3ef7c154e 100644 --- a/apps/codecs.h +++ b/apps/codecs.h @@ -27,10 +27,6 @@ #define NO_REDEFINES_PLEASE #endif -#ifndef MEM -#define MEM 2 -#endif - #include #include #include "strlcpy.h" diff --git a/apps/main.c b/apps/main.c index a7d6dc395c..6378833973 100644 --- a/apps/main.c +++ b/apps/main.c @@ -430,7 +430,7 @@ static void init(void) system_init(); #if defined(IPOD_VIDEO) audiobufend=(unsigned char *)audiobufend_lds; - if(MEM==64 && probed_ramsize!=64) + if(MEMORYSIZE==64 && probed_ramsize!=64) { audiobufend -= (32<<20); } diff --git a/apps/mpeg.c b/apps/mpeg.c index 583e4e2122..bdca92048f 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c @@ -1623,7 +1623,7 @@ static void mpeg_thread(void) #if (CONFIG_STORAGE & STORAGE_MMC) /* MMC is slow, so don't read too large chunks */ amount_to_read = MIN(0x40000, amount_to_read); -#elif MEM == 8 +#elif MEMORYSIZE == 8 amount_to_read = MIN(0x100000, amount_to_read); #endif @@ -1933,7 +1933,7 @@ static void mpeg_thread(void) #if (CONFIG_STORAGE & STORAGE_MMC) /* MMC is slow, so don't save too large chunks at once */ amount_to_save = MIN(0x40000, amount_to_save); -#elif MEM == 8 +#elif MEMORYSIZE == 8 amount_to_save = MIN(0x100000, amount_to_save); #endif rc = write(mpeg_file, audiobuf + audiobuf_read, diff --git a/apps/plugin.h b/apps/plugin.h index 4b11ac31e9..77dedc539a 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -27,10 +27,6 @@ #define NO_REDEFINES_PLEASE #endif -#ifndef MEM -#define MEM 2 -#endif - #include #include #include diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index 01a706be45..4dc88fdf5a 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -430,7 +430,7 @@ enum plugin_status plugin_start(const void* parameter) = rb->plugin_get_audio_buffer(&audio_buffer_free); plugbuf=false; } -#if MEM <= 8 && (CONFIG_PLATFORM & PLATFORM_NATIVE) +#if MEMORYSIZE <= 8 && (CONFIG_PLATFORM & PLATFORM_NATIVE) /* loaded as an overlay plugin, protect from overwriting ourselves */ if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase) < audio_buffer_free) diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c index 887c5cdd55..073af31280 100644 --- a/apps/plugins/wavplay.c +++ b/apps/plugins/wavplay.c @@ -3600,7 +3600,7 @@ int play_file(char* filename) wanted = MIN(free_space, aud_size - aud_write); #if (CONFIG_STORAGE & STORAGE_MMC) wanted = MIN(wanted, 256*1024); -#elif MEM == 8 +#elif MEMORYSIZE == 8 wanted = MIN(wanted, 1024*1024); #endif if (available() < low_water) diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c index 0221963b2b..6ecb75f608 100644 --- a/apps/recorder/pcm_record.c +++ b/apps/recorder/pcm_record.c @@ -131,7 +131,7 @@ static unsigned long pre_record_ticks; /* pre-record time in ticks */ ****************************************************************************/ /** buffer parameters where incoming PCM data is placed **/ -#if MEM <= 2 +#if MEMORYSIZE <= 2 #define PCM_NUM_CHUNKS 16 /* Power of 2 */ #else #define PCM_NUM_CHUNKS 256 /* Power of 2 */ @@ -180,13 +180,13 @@ static int flood_watermark; /* boost thread priority when here */ #ifdef HAVE_PRIORITY_SCHEDULING #define PRIO_SECONDS 10 /* max flush time before priority boost */ #endif -#if MEM <= 2 +#if MEMORYSIZE <= 2 /* fractions must be integer fractions of 4 because they are evaluated with * X*4*XXX_SECONDS, that way we avoid float calculation */ #define LOW_SECONDS 1/4 /* low watermark time till empty */ #define PANIC_SECONDS 1/2 /* flood watermark time until full */ #define FLUSH_SECONDS 1 /* flush watermark time until full */ -#elif MEM <= 16 +#elif MEMORYSIZE <= 16 #define LOW_SECONDS 1 /* low watermark time till empty */ #define PANIC_SECONDS 5 /* flood watermark time until full */ #define FLUSH_SECONDS 7 /* flush watermark time until full */ @@ -194,7 +194,7 @@ static int flood_watermark; /* boost thread priority when here */ #define LOW_SECONDS 1 /* low watermark time till empty */ #define PANIC_SECONDS 8 #define FLUSH_SECONDS 10 -#endif /* MEM */ +#endif /* MEMORYSIZE */ /** encoder events **/ static void (*enc_events_callback)(enum enc_events event, void *data); diff --git a/apps/settings_list.c b/apps/settings_list.c index c6f5e677eb..94910c0818 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -760,7 +760,7 @@ const struct settings_list settings[] = { SYSTEM_SETTING(NVRAM(4), topruntime, 0), INT_SETTING(F_BANFROMQS, max_files_in_playlist, LANG_MAX_FILES_IN_PLAYLIST, -#if MEM > 1 +#if MEMORYSIZE > 1 10000, #else 400, @@ -768,7 +768,7 @@ const struct settings_list settings[] = { "max files in playlist", UNIT_INT, 1000, 32000, 1000, NULL, NULL, NULL), INT_SETTING(F_BANFROMQS, max_files_in_dir, LANG_MAX_FILES_IN_DIR, -#if MEM > 1 +#if MEMORYSIZE > 1 1000, #else 200, diff --git a/apps/talk.c b/apps/talk.c index 7dbfb2ef77..ad34437b0f 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -112,7 +112,7 @@ struct queue_entry /* one entry of the internal queue */ /* The MMC storage on the Ondios is slow enough that we want to buffer the * talk clips only when they are needed */ # define TALK_PROGRESSIVE_LOAD -#elif CONFIG_CODEC == SWCODEC && MEM <= 2 +#elif CONFIG_CODEC == SWCODEC && MEMORYSIZE <= 2 /* The entire voice file wouldn't fit in memory together with codecs, so we * load clips each time they are accessed */ # define TALK_PARTIAL_LOAD -- cgit v1.2.3