diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2008-10-31 21:25:04 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2008-10-31 21:25:04 +0000 |
commit | 19d1cacb1a63c306d842f81127d382512c49a062 (patch) | |
tree | bac051d18aae2c9f201744890177e0021e5269be /apps | |
parent | 3aa58328080ab9a254d9f2329696fa4309a30d50 (diff) | |
download | rockbox-19d1cacb1a63c306d842f81127d382512c49a062.tar.gz rockbox-19d1cacb1a63c306d842f81127d382512c49a062.zip |
cleanup storage defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18950 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 20 | ||||
-rw-r--r-- | apps/main.c | 6 | ||||
-rw-r--r-- | apps/misc.c | 4 | ||||
-rw-r--r-- | apps/mpeg.c | 6 | ||||
-rw-r--r-- | apps/mpeg.h | 2 | ||||
-rw-r--r-- | apps/plugins/SOURCES | 3 | ||||
-rw-r--r-- | apps/plugins/alpine_cdc.c | 4 | ||||
-rw-r--r-- | apps/plugins/splitedit.c | 4 | ||||
-rw-r--r-- | apps/plugins/test_disk.c | 2 | ||||
-rw-r--r-- | apps/plugins/wavplay.c | 4 | ||||
-rw-r--r-- | apps/plugins/wavrecord.c | 6 | ||||
-rw-r--r-- | apps/screens.c | 8 | ||||
-rw-r--r-- | apps/screens.h | 2 | ||||
-rw-r--r-- | apps/talk.c | 10 |
14 files changed, 42 insertions, 39 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 8c4622828d..26534cc101 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -63,7 +63,7 @@ #include "fat.h" #include "mas.h" #include "eeprom_24cxx.h" -#if defined(HAVE_MMC) || defined(HAVE_ATA_SD) +#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) #include "hotswap.h" #endif #if CONFIG_TUNER @@ -1730,8 +1730,8 @@ static bool view_battery(void) #endif #ifndef SIMULATOR -#if defined(HAVE_MMC) || defined(HAVE_ATA_SD) -#if defined(HAVE_MMC) +#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) +#if (CONFIG_STORAGE & STORAGE_MMC) #define CARDTYPE "MMC" #else #define CARDTYPE "microSD" @@ -1812,7 +1812,7 @@ static int disk_callback(int btn, struct gui_synclist *lists) { simplelist_addline(SIMPLELIST_ADD_LINE, "Not Found!"); } -#ifndef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_SD) else /* card->initialized < 0 */ { simplelist_addline(SIMPLELIST_ADD_LINE, "Init Error! (%d)", card->initialized); @@ -1826,7 +1826,7 @@ static int disk_callback(int btn, struct gui_synclist *lists) } return btn; } -#else /* !defined(HAVE_MMC) && !defined(HAVE_ATA_SD) */ +#else /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */ static int disk_callback(int btn, struct gui_synclist *lists) { (void)lists; @@ -1960,13 +1960,13 @@ static bool dbg_identify_info(void) } return false; } -#endif /* !defined(HAVE_MMC) && !defined(HAVE_ATA_SD) */ +#endif /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */ static bool dbg_disk_info(void) { struct simplelist_info info; simplelist_info_init(&info, "Disk Info", 1, NULL); -#if defined(HAVE_MMC) || defined(HAVE_ATA_SD) +#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) char title[16]; int card = 0; info.callback_data = (void*)&card; @@ -2146,7 +2146,7 @@ static bool dbg_save_roms(void) return false; } -#elif defined(CPU_PP) && !defined(HAVE_ATA_SD) +#elif defined(CPU_PP) && !(CONFIG_STORAGE & STORAGE_SD) static bool dbg_save_roms(void) { int fd; @@ -2467,7 +2467,7 @@ struct the_menu_item { }; static const struct the_menu_item menuitems[] = { #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || \ - (defined(CPU_PP) && !defined(HAVE_ATA_SD)) + (defined(CPU_PP) && !(CONFIG_STORAGE & STORAGE_SD)) { "Dump ROM contents", dbg_save_roms }, #endif #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \ @@ -2504,7 +2504,7 @@ static const struct the_menu_item menuitems[] = { #endif #ifndef SIMULATOR { "View disk info", dbg_disk_info }, -#if !defined(HAVE_MMC) && !defined(HAVE_ATA_SD) +#if !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) { "Dump ATA identify info", dbg_identify_info}, #endif #endif diff --git a/apps/main.c b/apps/main.c index bacaa51e01..50597699c5 100644 --- a/apps/main.c +++ b/apps/main.c @@ -89,7 +89,7 @@ #if CONFIG_TUNER #include "radio.h" #endif -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) #include "ata_mmc.h" #endif @@ -377,7 +377,7 @@ static void init(void) #ifdef DEBUG debug_init(); #else -#if !defined(HAVE_FMADC) && !defined(HAVE_MMC) +#if !defined(HAVE_FMADC) && !(CONFIG_STORAGE & STORAGE_MMC) serial_setup(); #endif #endif @@ -456,7 +456,7 @@ static void init(void) #endif /* enter USB mode early, before trying to mount */ if (button_get_w_tmo(HZ/10) == SYS_USB_CONNECTED) -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) if (!mmc_touched() || (mmc_remove_request() == SYS_HOTSWAP_EXTRACTED)) #endif diff --git a/apps/misc.c b/apps/misc.c index cd59dbc40f..7c8ff0fbd8 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -61,7 +61,7 @@ #include "playlist.h" #include "yesno.h" -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) #include "ata_mmc.h" #endif #include "tree.h" @@ -910,7 +910,7 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame case SYS_USB_CONNECTED: if (callback != NULL) callback(parameter); -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) if (!mmc_touched() || (mmc_remove_request() == SYS_HOTSWAP_EXTRACTED)) #endif diff --git a/apps/mpeg.c b/apps/mpeg.c index 713915d5a6..3c37a6b22f 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c @@ -1603,7 +1603,8 @@ static void mpeg_thread(void) /* Don't read more than until the end of the buffer */ amount_to_read = MIN(audiobuflen - audiobuf_write, amount_to_read); -#ifdef HAVE_MMC /* MMC is slow, so don't read too large chunks */ +#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 amount_to_read = MIN(0x100000, amount_to_read); @@ -1912,7 +1913,8 @@ static void mpeg_thread(void) amount_to_save = MIN(amount_to_save, audiobuflen - audiobuf_read); -#ifdef HAVE_MMC /* MMC is slow, so don't save too large chunks at once */ +#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 amount_to_save = MIN(0x100000, amount_to_save); diff --git a/apps/mpeg.h b/apps/mpeg.h index f5ce613b8d..3aaa990881 100644 --- a/apps/mpeg.h +++ b/apps/mpeg.h @@ -32,7 +32,7 @@ #define MPEG_RECORDING_LOW_WATER 0x80000 #define MPEG_LOW_WATER_CHUNKSIZE 0x40000 #define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000 -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) #define MPEG_PLAY_PENDING_THRESHOLD 0x20000 #define MPEG_PLAY_PENDING_SWAPSIZE 0x20000 #else diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 0c27a5b1de..a4ddbacfd0 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -120,7 +120,8 @@ nim.c mp3_encoder.c wav2wv.c #else /* hardware codec platforms */ -#ifndef HAVE_MMC /* not for Ondio, has no remote control pin */ +#if !defined(ARCHOS_ONDIOSP) && !defined(ARCHOS_ONDIOFM) + /* not for Ondio, has no remote control pin */ alpine_cdc.c #endif splitedit.c diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c index f23255aea6..dfffc3b3cd 100644 --- a/apps/plugins/alpine_cdc.c +++ b/apps/plugins/alpine_cdc.c @@ -34,7 +34,7 @@ #include "plugin.h" /* Only build for (correct) target */ -#if CONFIG_CPU==SH7034 && !defined(HAVE_MMC) +#if CONFIG_CPU==SH7034 && !(CONFIG_STORAGE & STORAGE_MMC) PLUGIN_HEADER @@ -1199,4 +1199,4 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame return (main(parameter)==0) ? PLUGIN_OK : PLUGIN_ERROR; } -#endif /* CONFIG_CPU==SH7034 && !defined(HAVE_MMC) */ +#endif /* CONFIG_CPU==SH7034 && !(CONFIG_STORAGE & STORAGE_MMC) */ diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c index 8de6a746ab..dda46a0f29 100644 --- a/apps/plugins/splitedit.c +++ b/apps/plugins/splitedit.c @@ -1044,7 +1044,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split, case LOOP_MODE_TO: rb->audio_pause(); rb->audio_ff_rewind(range_start); -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) /* MMC is slow - wait some time to allow track reload to finish */ rb->sleep(HZ/20); if (mp3->elapsed > play_end) /* reload in progress */ @@ -1056,7 +1056,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split, case LOOP_MODE_FROM: rb->audio_pause(); rb->audio_ff_rewind(xpos_to_time(split_x)); -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) /* MMC is slow - wait some time to allow track reload to finish */ rb->sleep(HZ/20); if (mp3->elapsed > play_end) /* reload in progress */ diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c index 7638fbf831..2e421e151e 100644 --- a/apps/plugins/test_disk.c +++ b/apps/plugins/test_disk.c @@ -29,7 +29,7 @@ PLUGIN_HEADER #define TEST_FILE TESTBASEDIR "/test_disk.tmp" #define FRND_SEED 0x78C3 /* arbirary */ -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) #define TEST_SIZE (20*1024*1024) #else #define TEST_SIZE (300*1024*1024) diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c index 333d16135c..c37b656d1c 100644 --- a/apps/plugins/wavplay.c +++ b/apps/plugins/wavplay.c @@ -3574,7 +3574,7 @@ int play_file(char* filename) while (!(SSR0 & SCI_TEND)); /* wait for end of transfer */ BRR0 = 0; /* maximum speed, ~3 MBit/s */ -#ifndef HAVE_MMC +#if !(CONFIG_STORAGE & STORAGE_MMC) low_water = 5 /* seconds */ * 2 /* bytes per sample */ * channels @@ -3603,7 +3603,7 @@ int play_file(char* filename) else { wanted = MIN(free_space, aud_size - aud_write); -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) wanted = MIN(wanted, 256*1024); #elif MEM == 8 wanted = MIN(wanted, 1024*1024); diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c index d57a61a6a2..d4b8bf1fd2 100644 --- a/apps/plugins/wavrecord.c +++ b/apps/plugins/wavrecord.c @@ -3587,7 +3587,7 @@ static int record_file(char *filename) if (to_save > aud_size) { rec_tick_enable(false); -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) rb->splash(HZ, "Data overrun (slow MMC)"); #else rb->splash(HZ, "Data overrun"); @@ -3597,7 +3597,7 @@ static int record_file(char *filename) break; } write_now = MIN(to_save, aud_size - aud_read); -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) write_now = MIN(write_now, 256*1024); #else write_now = MIN(write_now, 1024*1024); @@ -3802,7 +3802,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame return rc; #if 0 -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) return record_file("/<MMC1>/test.wav"); #else return record_file("/test.wav"); diff --git a/apps/screens.c b/apps/screens.c index d8ce695a9a..753b666902 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -68,7 +68,7 @@ #include <bitmaps/remote_usblogo.h> #endif -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) #include "ata_mmc.h" #endif #if CONFIG_CODEC == SWCODEC @@ -145,9 +145,9 @@ void usb_screen(void) usb_acknowledge(SYS_USB_CONNECTED_ACK); while(usb_wait_for_disconnect_w_tmo(&button_queue, HZ)) { if(usb_inserted()) { -#ifdef HAVE_MMC /* USB-MMC bridge can report activity */ +#if (CONFIG_STORAGE & STORAGE_MMC) /* USB-MMC bridge can report activity */ led(mmc_usb_active(HZ)); -#endif /* HAVE_MMC */ +#endif /* STORAGE_MMC */ gui_syncstatusbar_draw(&statusbars, false); } } @@ -161,7 +161,7 @@ void usb_screen(void) #endif /* USB_NONE */ } -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) int mmc_remove_request(void) { struct queue_event ev; diff --git a/apps/screens.h b/apps/screens.h index d024cc5f2e..eb613fc178 100644 --- a/apps/screens.h +++ b/apps/screens.h @@ -34,7 +34,7 @@ int charging_screen(void); void charging_splash(void); #endif -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) int mmc_remove_request(void); #endif diff --git a/apps/talk.c b/apps/talk.c index 2da4cd5c26..44ba063655 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -187,7 +187,7 @@ static unsigned char* get_clip(long id, long* p_size) return NULL; clipbuf = (unsigned char *) p_voicefile + p_voicefile->index[id].offset; -#ifdef HAVE_MMC /* dynamic loading, on demand */ +#if (CONFIG_STORAGE & STORAGE_MMC) /* dynamic loading, on demand */ if (!(clipsize & LOADED_MASK)) { /* clip used for the first time, needs loading */ lseek(filehandle, p_voicefile->index[id].offset, SEEK_SET); @@ -225,7 +225,7 @@ static void load_voicefile(void) if (file_size > audiobufend - audiobuf) /* won't fit? */ goto load_err; -#ifdef HAVE_MMC /* load only the header for now */ +#if (CONFIG_STORAGE & STORAGE_MMC) /* load only the header for now */ load_size = offsetof(struct voicefile, index); #else /* load the full file */ load_size = file_size; @@ -266,7 +266,7 @@ static void load_voicefile(void) structec_convert(&p_voicefile->index[i], "ll", 1, true); #endif -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) /* load the index table, now that we know its size from the header */ load_size = (p_voicefile->id1_max + p_voicefile->id2_max) * sizeof(struct clip_entry); @@ -520,7 +520,7 @@ void talk_init(void) return; } -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) if (filehandle >= 0) /* MMC: An old voice file might still be open */ { close(filehandle); @@ -577,7 +577,7 @@ void talk_buffer_steal(void) #if CONFIG_CODEC != SWCODEC mp3_play_stop(); #endif -#ifdef HAVE_MMC +#if (CONFIG_STORAGE & STORAGE_MMC) if (filehandle >= 0) /* only relevant for MMC */ { close(filehandle); |