summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Gjenero <dreamlayers@rockbox.org>2011-12-06 00:58:01 +0000
committerBoris Gjenero <dreamlayers@rockbox.org>2011-12-06 00:58:01 +0000
commit694502a96576afb22af4de21dfb85002e8ab44fc (patch)
tree53a7de699c6adadb23a6b1a36f21b76fd6bd7461
parentfb6b28d11cd4332caba4f03996e334d4e9a5aed4 (diff)
downloadrockbox-694502a96576afb22af4de21dfb85002e8ab44fc.tar.gz
rockbox-694502a96576afb22af4de21dfb85002e8ab44fc.zip
Fix FS#12423 : Rockbox access to /.rockbox/fonts after usb_enable(true). This fixes entry into USB mode on the Archos Recorder V2 and possibly also other targets using a USB to IDE bridge chip. Fred Bauer found this removes the need for a workaround in glyph_cache_save(). I'm including his patch which removes the workaround.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31155 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/usb_screen.c4
-rw-r--r--firmware/font.c5
2 files changed, 2 insertions, 7 deletions
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index 32c0773ed6..31e0829eb7 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -251,8 +251,6 @@ void gui_usb_screen_run(bool early_usb)
251 touchscreen_set_mode(TOUCHSCREEN_BUTTON); 251 touchscreen_set_mode(TOUCHSCREEN_BUTTON);
252#endif 252#endif
253 253
254 usb_acknowledge(SYS_USB_CONNECTED_ACK);
255
256#ifdef USB_ENABLE_HID 254#ifdef USB_ENABLE_HID
257 usb_hid = global_settings.usb_hid; 255 usb_hid = global_settings.usb_hid;
258 usb_keypad_mode = global_settings.usb_keypad_mode; 256 usb_keypad_mode = global_settings.usb_keypad_mode;
@@ -284,6 +282,8 @@ void gui_usb_screen_run(bool early_usb)
284#endif 282#endif
285 } 283 }
286 284
285 usb_acknowledge(SYS_USB_CONNECTED_ACK);
286
287 while (1) 287 while (1)
288 { 288 {
289 usb_screens_draw(usb_screen_vps_ar); 289 usb_screens_draw(usb_screen_vps_ar);
diff --git a/firmware/font.c b/firmware/font.c
index 2b86d338db..64bbf50d76 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -815,11 +815,6 @@ static void glyph_cache_save(int font_id)
815 struct font *pf = pf_from_handle(handle); 815 struct font *pf = pf_from_handle(handle);
816 if(pf && pf->fd >= 0) 816 if(pf && pf->fd >= 0)
817 { 817 {
818 /* FIXME: This sleep should not be necessary but without it *
819 * unloading multiple fonts and saving glyphcache files *
820 * quickly in succession creates multiple glyphcache files *
821 * with the same name. */
822 sleep(HZ/10);
823 char filename[MAX_PATH]; 818 char filename[MAX_PATH];
824 font_path_to_glyph_path(font_filename(font_id), filename); 819 font_path_to_glyph_path(font_filename(font_id), filename);
825 fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666); 820 fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);