Hotswap code shuffling: Fix yellow. Simplify some target function access. Keep fat lock access from compiling for Ondios - think of a nicer way later.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16637 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
06a5299aff
commit
e37044ff1d
|
@ -104,7 +104,7 @@ int disk_mount_all(void)
|
|||
int mounted;
|
||||
int i;
|
||||
|
||||
#if defined(HAVE_MMC) || defined(HAVE_HOTSWAP)
|
||||
#ifdef HAVE_HOTSWAP
|
||||
card_enable_monitoring(false);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE];
|
|||
static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE];
|
||||
static struct mutex cache_mutex NOCACHEBSS_ATTR;
|
||||
|
||||
#ifdef HAVE_HOTSWAP
|
||||
#if defined(HAVE_HOTSWAP) && !defined(HAVE_MMC) /* A better condition ?? */
|
||||
void fat_lock(void)
|
||||
{
|
||||
mutex_lock(&cache_mutex);
|
||||
|
|
|
@ -40,8 +40,10 @@ typedef struct
|
|||
} tCardInfo;
|
||||
|
||||
#ifdef TARGET_TREE
|
||||
bool card_detect(void);
|
||||
tCardInfo *card_get_info(int card_no);
|
||||
#include "hotswap-target.h"
|
||||
#define card_detect card_detect_target
|
||||
#define card_get_info card_get_info_target
|
||||
#define card_enable_monitoring card_enable_monitoring_target
|
||||
#else /* HAVE_MMC */
|
||||
#include "ata_mmc.h"
|
||||
#define card_detect mmc_detect
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
****************************************************************************/
|
||||
#include <stdbool.h>
|
||||
#include "config.h"
|
||||
#ifdef TARGET_TREE
|
||||
#include "hotswap-target.h"
|
||||
#else
|
||||
#ifdef HAVE_MMC
|
||||
#include "ata_mmc.h"
|
||||
#else
|
||||
#include "hotswap.h"
|
||||
#endif
|
||||
|
||||
/* helper function to extract n (<=32) bits from an arbitrary position.
|
||||
|
@ -44,15 +44,3 @@ unsigned long card_extract_bits(
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef TARGET_TREE
|
||||
bool card_detect(void)
|
||||
{
|
||||
return card_detect_target();
|
||||
}
|
||||
|
||||
tCardInfo *card_get_info(int card_no)
|
||||
{
|
||||
return card_get_info_target(card_no);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
#include "fat.h"
|
||||
#include "hotswap-target.h"
|
||||
#include "hotswap.h"
|
||||
#include "ata-target.h"
|
||||
#include "ata_idle_notify.h"
|
||||
#include "system.h"
|
||||
|
@ -1147,7 +1147,7 @@ void ata_enable(bool on)
|
|||
}
|
||||
|
||||
#ifdef HAVE_HOTSWAP
|
||||
void card_enable_monitoring(bool on)
|
||||
void card_enable_monitoring_target(bool on)
|
||||
{
|
||||
if (on)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#define HOTSWAP_TARGET_H
|
||||
|
||||
#include "inttypes.h"
|
||||
#include "hotswap.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -41,5 +40,6 @@ typedef struct
|
|||
|
||||
tCardInfo *card_get_info_target(int card_no);
|
||||
bool card_detect_target(void);
|
||||
void card_enable_monitoring_target(bool on);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user