summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config/sansafuzeplus.h3
-rw-r--r--firmware/target/arm/imx233/sdmmc-imx233.c13
2 files changed, 16 insertions, 0 deletions
diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h
index 1364d75637..7c40600fc8 100644
--- a/firmware/export/config/sansafuzeplus.h
+++ b/firmware/export/config/sansafuzeplus.h
@@ -192,6 +192,9 @@
/* Define this if you have adjustable CPU frequency */
//#define HAVE_ADJUSTABLE_CPU_FREQ
+/* Virtual LED (icon) */
+#define CONFIG_LED LED_VIRTUAL
+
#define BOOTFILE_EXT "sansa"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c
index e0966f784b..32d0013574 100644
--- a/firmware/target/arm/imx233/sdmmc-imx233.c
+++ b/firmware/target/arm/imx233/sdmmc-imx233.c
@@ -33,6 +33,7 @@
#include "debug.h"
#include "string.h"
#include "ata_idle_notify.h"
+#include "led.h"
/** NOTE For convenience, this drivers relies on the many similar commands
* between SD and MMC. The following assumptions are made:
@@ -501,6 +502,13 @@ static int __xfer_sectors(int drive, unsigned long start, int count, void *buf,
return ret;
}
+static void do_led(int delta)
+{
+ static int level = 0;
+ level += delta;
+ led(level > 0);
+}
+
static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read)
{
int ret = 0;
@@ -511,6 +519,9 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
/* lock per-drive mutex */
mutex_lock(&mutex[drive]);
+ /* update led status */
+ do_led(1);
+
/* for SD cards, init if necessary */
#if CONFIG_STORAGE & STORAGE_SD
if(SDMMC_MODE(drive) == SD_MODE && SDMMC_INFO(drive).initialized <= 0)
@@ -604,6 +615,8 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
if(!send_cmd(drive, SD_DESELECT_CARD, 0, MCI_NO_RESP, NULL))
ret = -23;
Lend:
+ /* update led status */
+ do_led(-1);
/* release per-drive mutex */
mutex_unlock(&mutex[drive]);
return ret;