dm320: call storage idle notifys on in sdmmc thread

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31086 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomasz Moń 2011-11-28 21:12:54 +00:00
parent a884ec2017
commit 297c29cba6
3 changed files with 20 additions and 2 deletions

View file

@ -28,11 +28,13 @@
static unsigned int current_battery_level = 100;
/* This specifies the battery level that writes are still safe */
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
0
1
};
/* Below this the player cannot be considered to operate reliably */
const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
{
0

View file

@ -27,6 +27,7 @@
#include "panic.h"
#include "kernel.h"
#include "dma-target.h"
#include "ata_idle_notify.h"
//#define SD_DEBUG
@ -576,8 +577,8 @@ static void sd_thread(void) NORETURN_ATTR;
static void sd_thread(void)
{
struct queue_event ev;
bool idle_notified = false;
/* TODO */
while (1)
{
queue_wait_w_tmo(&sd_queue, &ev, HZ);
@ -627,6 +628,17 @@ static void sd_thread(void)
}
break;
#endif
case SYS_TIMEOUT:
if (TIME_BEFORE(current_tick, last_disk_activity+(3*HZ)))
{
idle_notified = false;
}
else if (!idle_notified)
{
call_storage_idle_notifys(false);
idle_notified = true;
}
break;
}
}
}

View file

@ -359,6 +359,10 @@ void system_init(void)
#endif
#ifdef SANSA_CONNECT
/* keep WIFI CS low to save power */
IO_GIO_DIR0 &= ~(1 << 4);
IO_GIO_BITCLR0 = (1 << 4);
i2c_init();
avr_hid_init();
avr_hid_enable_charger();