forked from len0rd/rockbox
Simplify preprocessor symbols a bit (FS#9457). Thanks to Alexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18816 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5491273f86
commit
9e0ebcc4e6
1 changed files with 10 additions and 6 deletions
|
@ -141,6 +141,10 @@ static void ata_lock_unlock(struct ata_lock *l)
|
||||||
#define mutex_unlock ata_lock_unlock
|
#define mutex_unlock ata_lock_unlock
|
||||||
#endif /* MAX_PHYS_SECTOR_SIZE */
|
#endif /* MAX_PHYS_SECTOR_SIZE */
|
||||||
|
|
||||||
|
#if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) && !defined(BOOTLOADER)
|
||||||
|
#define ALLOW_USB_SPINDOWN
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct mutex ata_mtx SHAREDBSS_ATTR;
|
static struct mutex ata_mtx SHAREDBSS_ATTR;
|
||||||
static int ata_device; /* device 0 (master) or 1 (slave) */
|
static int ata_device; /* device 0 (master) or 1 (slave) */
|
||||||
|
|
||||||
|
@ -884,7 +888,7 @@ static void ata_thread(void)
|
||||||
static long last_sleep = 0;
|
static long last_sleep = 0;
|
||||||
struct queue_event ev;
|
struct queue_event ev;
|
||||||
static long last_seen_mtx_unlock = 0;
|
static long last_seen_mtx_unlock = 0;
|
||||||
#if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) && !defined(BOOTLOADER)
|
#ifdef ALLOW_USB_SPINDOWN
|
||||||
static bool usb_mode = false;
|
static bool usb_mode = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -901,7 +905,7 @@ static void ata_thread(void)
|
||||||
last_seen_mtx_unlock = current_tick;
|
last_seen_mtx_unlock = current_tick;
|
||||||
if (TIME_AFTER(current_tick, last_seen_mtx_unlock+(HZ*2)))
|
if (TIME_AFTER(current_tick, last_seen_mtx_unlock+(HZ*2)))
|
||||||
{
|
{
|
||||||
#if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) && !defined(BOOTLOADER)
|
#ifdef ALLOW_USB_SPINDOWN
|
||||||
if(!usb_mode)
|
if(!usb_mode)
|
||||||
#endif
|
#endif
|
||||||
call_ata_idle_notifys(false);
|
call_ata_idle_notifys(false);
|
||||||
|
@ -914,7 +918,7 @@ static void ata_thread(void)
|
||||||
TIME_AFTER( current_tick,
|
TIME_AFTER( current_tick,
|
||||||
last_disk_activity + sleep_timeout ) )
|
last_disk_activity + sleep_timeout ) )
|
||||||
{
|
{
|
||||||
#if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) && !defined(BOOTLOADER)
|
#ifdef ALLOW_USB_SPINDOWN
|
||||||
if(!usb_mode)
|
if(!usb_mode)
|
||||||
#endif
|
#endif
|
||||||
call_ata_idle_notifys(true);
|
call_ata_idle_notifys(true);
|
||||||
|
@ -949,7 +953,7 @@ static void ata_thread(void)
|
||||||
DEBUGF("ata_thread got SYS_USB_CONNECTED\n");
|
DEBUGF("ata_thread got SYS_USB_CONNECTED\n");
|
||||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||||
|
|
||||||
#if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) && !defined(BOOTLOADER)
|
#ifdef ALLOW_USB_SPINDOWN
|
||||||
usb_mode = true;
|
usb_mode = true;
|
||||||
#else
|
#else
|
||||||
/* Wait until the USB cable is extracted again */
|
/* Wait until the USB cable is extracted again */
|
||||||
|
@ -957,7 +961,7 @@ static void ata_thread(void)
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) && !defined(BOOTLOADER)
|
#ifdef ALLOW_USB_SPINDOWN
|
||||||
case SYS_USB_DISCONNECTED:
|
case SYS_USB_DISCONNECTED:
|
||||||
/* Tell the USB thread that we are ready again */
|
/* Tell the USB thread that we are ready again */
|
||||||
DEBUGF("ata_thread got SYS_USB_DISCONNECTED\n");
|
DEBUGF("ata_thread got SYS_USB_DISCONNECTED\n");
|
||||||
|
@ -967,7 +971,7 @@ static void ata_thread(void)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
case Q_SLEEP:
|
case Q_SLEEP:
|
||||||
#if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) && !defined(BOOTLOADER)
|
#ifdef ALLOW_USB_SPINDOWN
|
||||||
if(!usb_mode)
|
if(!usb_mode)
|
||||||
#endif
|
#endif
|
||||||
call_ata_idle_notifys(false);
|
call_ata_idle_notifys(false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue