summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/lang/deutsch.lang6
-rw-r--r--apps/lang/english.lang6
-rw-r--r--apps/misc.c8
-rw-r--r--apps/screens.c27
-rw-r--r--apps/screens.h4
5 files changed, 49 insertions, 2 deletions
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang
index f4cfa864af..0ff4778721 100644
--- a/apps/lang/deutsch.lang
+++ b/apps/lang/deutsch.lang
@@ -2827,3 +2827,9 @@ desc: in browse root
eng: "Installation incomplete"
voice: ""
new: "Installation unvollständig"
+
+id: LANG_REMOVE_MMC
+desc: before acknowledging usb in case an MMC is inserted (Ondio)
+eng: "Please remove inserted MMC"
+voice: "Bitte Multimediakarte entfernen"
+new: "Bitte eingelegte MMC entfernen"
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index facbe7eaf9..fd3d4d297a 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -2841,3 +2841,9 @@ desc: in browse root
eng: "Installation incomplete"
voice: ""
new:
+
+id: LANG_REMOVE_MMC
+desc: before acknowledging usb in case an MMC is inserted (Ondio)
+eng: "Please remove inserted MMC"
+voice: "Please remove multimedia card"
+new:
diff --git a/apps/misc.c b/apps/misc.c
index ced0668ae6..96d23a8388 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -34,6 +34,9 @@
#include "ata.h"
#include "kernel.h"
#include "power.h"
+#ifdef HAVE_MMC
+#include "ata_mmc.h"
+#endif
#define ONE_KILOBYTE 1024
#define ONE_MEGABYTE (1024*1024)
@@ -231,7 +234,10 @@ int default_event_handler(int event)
switch(event)
{
case SYS_USB_CONNECTED:
- usb_screen();
+#ifdef HAVE_MMC
+ if (!mmc_detect() || (mmc_remove_request() == SYS_MMC_EXTRACTED))
+#endif
+ usb_screen();
return SYS_USB_CONNECTED;
}
return 0;
diff --git a/apps/screens.c b/apps/screens.c
index b31067ad27..ac8dea1c24 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -40,7 +40,8 @@
#include "action.h"
#include "talk.h"
#include "misc.h"
-#include "id3.h"
+#include "id3.h"
+#include "screens.h"
#ifdef HAVE_LCD_BITMAP
#define BMPHEIGHT_usb_logo 32
@@ -121,6 +122,30 @@ void usb_screen(void)
#endif /* USB_NONE */
}
+#ifdef HAVE_MMC
+int mmc_remove_request(void)
+{
+ struct event ev;
+
+ lcd_clear_display();
+ splash(1, true, str(LANG_REMOVE_MMC));
+ talk_id(LANG_REMOVE_MMC, false);
+
+ while (1)
+ {
+ queue_wait_w_tmo(&button_queue, &ev, HZ/2);
+ switch (ev.id)
+ {
+ case SYS_MMC_EXTRACTED:
+ return SYS_MMC_EXTRACTED;
+
+ case SYS_USB_DISCONNECTED:
+ return SYS_USB_DISCONNECTED;
+ }
+ }
+}
+#endif
+
/* some simulator dummies */
#ifdef SIMULATOR
diff --git a/apps/screens.h b/apps/screens.h
index 47b85af821..8940bb590c 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -26,6 +26,10 @@ void usb_screen(void);
int charging_screen(void);
void charging_splash(void);
+#ifdef HAVE_MMC
+int mmc_remove_request(void);
+#endif
+
#if CONFIG_KEYPAD == RECORDER_PAD
int pitch_screen(void);
bool quick_screen(const int, const int);