diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-11-26 00:37:27 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-11-26 00:37:27 +0000 |
commit | 1ecb7536689277d934a3584c27a142cd0f19d0ac (patch) | |
tree | 43e57bedb292669536d7b3267fe17cc31a21cf2e | |
parent | 10753f195bb14413e179ae3091b633c636973760 (diff) | |
download | rockbox-1ecb7536689277d934a3584c27a142cd0f19d0ac.tar.gz rockbox-1ecb7536689277d934a3584c27a142cd0f19d0ac.zip |
Redo a hack that precluded entering a folder on an ejected hotswap drive. Use storage api and proper defines for the drive folder instead.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23755 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/root_menu.c | 41 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/crt0.S | 2 |
2 files changed, 35 insertions, 8 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c index b02d2a1be8..e475db1f5d 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -37,8 +37,12 @@ | |||
37 | #include "power.h" | 37 | #include "power.h" |
38 | #include "talk.h" | 38 | #include "talk.h" |
39 | #include "audio.h" | 39 | #include "audio.h" |
40 | #include "hotswap.h" | ||
41 | 40 | ||
41 | #ifdef HAVE_HOTSWAP | ||
42 | #include "storage.h" | ||
43 | #include "hotswap.h" | ||
44 | #include "dir.h" | ||
45 | #endif | ||
42 | /* gui api */ | 46 | /* gui api */ |
43 | #include "list.h" | 47 | #include "list.h" |
44 | #include "splash.h" | 48 | #include "splash.h" |
@@ -110,14 +114,37 @@ static int browser(void* param) | |||
110 | { | 114 | { |
111 | strcpy(folder, current_track_path); | 115 | strcpy(folder, current_track_path); |
112 | } | 116 | } |
113 | #ifdef HAVE_HOTSWAP /* quick hack to stop crashing if you try entering | ||
114 | the browser from the menu when you were in the card | ||
115 | and it was removed */ | ||
116 | else if (strchr(last_folder, '<') && (card_detect() == false)) | ||
117 | strcpy(folder, "/"); | ||
118 | #endif | ||
119 | else | 117 | else |
118 | { | ||
119 | #ifdef HAVE_HOTSWAP | ||
120 | bool in_hotswap = false; | ||
121 | /* handle entering an ejected drive */ | ||
122 | int i; | ||
123 | for (i = 0; i < NUM_VOLUMES; i++) | ||
124 | { | ||
125 | char vol_string[VOL_ENUM_POS + 8]; | ||
126 | if (!storage_removable(i)) | ||
127 | continue; | ||
128 | /* VOL_NAMES contains a %d */ | ||
129 | snprintf(vol_string, sizeof(vol_string), "/"VOL_NAMES, i); | ||
130 | /* test whether we would browse the external card */ | ||
131 | if (!storage_present(i) && | ||
132 | (strstr(last_folder, vol_string) | ||
133 | #ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN | ||
134 | || (i == 0) | ||
135 | #endif | ||
136 | )) | ||
137 | { /* leave folder as "/" to avoid crash when trying | ||
138 | * to access an ejected drive */ | ||
139 | strcpy(folder, "/"); | ||
140 | in_hotswap = true; | ||
141 | break; | ||
142 | } | ||
143 | } | ||
144 | if (!in_hotswap) | ||
145 | #endif | ||
120 | strcpy(folder, last_folder); | 146 | strcpy(folder, last_folder); |
147 | } | ||
121 | break; | 148 | break; |
122 | #ifdef HAVE_TAGCACHE | 149 | #ifdef HAVE_TAGCACHE |
123 | case GO_TO_DBBROWSER: | 150 | case GO_TO_DBBROWSER: |
diff --git a/firmware/target/arm/s3c2440/crt0.S b/firmware/target/arm/s3c2440/crt0.S index 2188bc07da..2bee37fdb9 100644 --- a/firmware/target/arm/s3c2440/crt0.S +++ b/firmware/target/arm/s3c2440/crt0.S | |||
@@ -555,7 +555,7 @@ stackmunge: | |||
555 | ldr sp, =stackend | 555 | ldr sp, =stackend |
556 | 556 | ||
557 | /* Start the main function */ | 557 | /* Start the main function */ |
558 | adr lr, vectors | 558 | ldr lr, =vectors |
559 | ldr pc, =main | 559 | ldr pc, =main |
560 | 560 | ||
561 | /* Should never get here, but let's restart in case (also needed for | 561 | /* Should never get here, but let's restart in case (also needed for |