From c0a5a67387c4eec3db3bad4da77ba5126faf03c4 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Fri, 17 Jul 2009 22:28:49 +0000 Subject: Commit FS#9545, storage cleanup and multi-driver support git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config.h | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'firmware/export/config.h') diff --git a/firmware/export/config.h b/firmware/export/config.h index 406ef509c8..092e02f458 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -539,11 +539,6 @@ Lyre prototype 1*/ #define CONFIG_TUNER_MULTI #endif -#if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0 -/* Multiple storage drivers */ -#define CONFIG_STORAGE_MULTI -#endif - /* deactivate fading in bootloader/sim */ #if defined(BOOTLOADER) || defined(SIMULATOR) #undef CONFIG_BACKLIGHT_FADING @@ -571,6 +566,37 @@ Lyre prototype 1*/ #endif /* CONFIG_BACKLIGHT_FADING */ +/* Storage related config handling */ + +#if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0 +/* Multiple storage drivers */ +#define CONFIG_STORAGE_MULTI +#endif + +/* Explicit HAVE_MULTIVOLUME in the config file. Allow the maximum number */ +#ifdef HAVE_MULTIVOLUME +#define NUM_VOLUMES_PER_DRIVE 4 +#else +#define NUM_VOLUMES_PER_DRIVE 1 +#endif +#if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE) +#define HAVE_MULTIDRIVE +#endif + +#if defined(HAVE_MULTIDRIVE) && !defined(HAVE_MULTIVOLUME) +#define HAVE_MULTIVOLUME +#endif + +#if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES) +#error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES +#endif + +#ifndef NUM_DRIVES +#define NUM_DRIVES 1 +#endif + +#define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE) + #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ) /* Bootloaders don't use CPU frequency adjustment */ #undef HAVE_ADJUSTABLE_CPU_FREQ -- cgit v1.2.3