diff options
-rw-r--r-- | firmware/common/disk.c | 2 | ||||
-rw-r--r-- | firmware/drivers/fat.c | 2 | ||||
-rw-r--r-- | firmware/export/hotswap.h | 6 | ||||
-rw-r--r-- | firmware/hotswap.c | 18 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/ata-c200_e200.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/hotswap-target.h | 2 |
6 files changed, 12 insertions, 22 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c index c6200ba286..d4cfbc1a05 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c | |||
@@ -104,7 +104,7 @@ int disk_mount_all(void) | |||
104 | int mounted; | 104 | int mounted; |
105 | int i; | 105 | int i; |
106 | 106 | ||
107 | #if defined(HAVE_MMC) || defined(HAVE_HOTSWAP) | 107 | #ifdef HAVE_HOTSWAP |
108 | card_enable_monitoring(false); | 108 | card_enable_monitoring(false); |
109 | #endif | 109 | #endif |
110 | 110 | ||
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index f3374fc4c4..8ae3b70cd3 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c | |||
@@ -203,7 +203,7 @@ static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE]; | |||
203 | static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE]; | 203 | static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE]; |
204 | static struct mutex cache_mutex NOCACHEBSS_ATTR; | 204 | static struct mutex cache_mutex NOCACHEBSS_ATTR; |
205 | 205 | ||
206 | #ifdef HAVE_HOTSWAP | 206 | #if defined(HAVE_HOTSWAP) && !defined(HAVE_MMC) /* A better condition ?? */ |
207 | void fat_lock(void) | 207 | void fat_lock(void) |
208 | { | 208 | { |
209 | mutex_lock(&cache_mutex); | 209 | mutex_lock(&cache_mutex); |
diff --git a/firmware/export/hotswap.h b/firmware/export/hotswap.h index 4a1b1717ca..03971098b9 100644 --- a/firmware/export/hotswap.h +++ b/firmware/export/hotswap.h | |||
@@ -40,8 +40,10 @@ typedef struct | |||
40 | } tCardInfo; | 40 | } tCardInfo; |
41 | 41 | ||
42 | #ifdef TARGET_TREE | 42 | #ifdef TARGET_TREE |
43 | bool card_detect(void); | 43 | #include "hotswap-target.h" |
44 | tCardInfo *card_get_info(int card_no); | 44 | #define card_detect card_detect_target |
45 | #define card_get_info card_get_info_target | ||
46 | #define card_enable_monitoring card_enable_monitoring_target | ||
45 | #else /* HAVE_MMC */ | 47 | #else /* HAVE_MMC */ |
46 | #include "ata_mmc.h" | 48 | #include "ata_mmc.h" |
47 | #define card_detect mmc_detect | 49 | #define card_detect mmc_detect |
diff --git a/firmware/hotswap.c b/firmware/hotswap.c index 5620edf10b..bbcdabf649 100644 --- a/firmware/hotswap.c +++ b/firmware/hotswap.c | |||
@@ -18,10 +18,10 @@ | |||
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include <stdbool.h> | 19 | #include <stdbool.h> |
20 | #include "config.h" | 20 | #include "config.h" |
21 | #ifdef TARGET_TREE | 21 | #ifdef HAVE_MMC |
22 | #include "hotswap-target.h" | ||
23 | #else | ||
24 | #include "ata_mmc.h" | 22 | #include "ata_mmc.h" |
23 | #else | ||
24 | #include "hotswap.h" | ||
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | /* helper function to extract n (<=32) bits from an arbitrary position. | 27 | /* helper function to extract n (<=32) bits from an arbitrary position. |
@@ -44,15 +44,3 @@ unsigned long card_extract_bits( | |||
44 | 44 | ||
45 | return result; | 45 | return result; |
46 | } | 46 | } |
47 | |||
48 | #ifdef TARGET_TREE | ||
49 | bool card_detect(void) | ||
50 | { | ||
51 | return card_detect_target(); | ||
52 | } | ||
53 | |||
54 | tCardInfo *card_get_info(int card_no) | ||
55 | { | ||
56 | return card_get_info_target(card_no); | ||
57 | } | ||
58 | #endif | ||
diff --git a/firmware/target/arm/sandisk/ata-c200_e200.c b/firmware/target/arm/sandisk/ata-c200_e200.c index 99a00358ff..8eb4a343f7 100644 --- a/firmware/target/arm/sandisk/ata-c200_e200.c +++ b/firmware/target/arm/sandisk/ata-c200_e200.c | |||
@@ -17,7 +17,7 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "fat.h" | 19 | #include "fat.h" |
20 | #include "hotswap-target.h" | 20 | #include "hotswap.h" |
21 | #include "ata-target.h" | 21 | #include "ata-target.h" |
22 | #include "ata_idle_notify.h" | 22 | #include "ata_idle_notify.h" |
23 | #include "system.h" | 23 | #include "system.h" |
@@ -1147,7 +1147,7 @@ void ata_enable(bool on) | |||
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | #ifdef HAVE_HOTSWAP | 1149 | #ifdef HAVE_HOTSWAP |
1150 | void card_enable_monitoring(bool on) | 1150 | void card_enable_monitoring_target(bool on) |
1151 | { | 1151 | { |
1152 | if (on) | 1152 | if (on) |
1153 | { | 1153 | { |
diff --git a/firmware/target/arm/sandisk/hotswap-target.h b/firmware/target/arm/sandisk/hotswap-target.h index cab2afe163..c7cd2b8d4f 100644 --- a/firmware/target/arm/sandisk/hotswap-target.h +++ b/firmware/target/arm/sandisk/hotswap-target.h | |||
@@ -20,7 +20,6 @@ | |||
20 | #define HOTSWAP_TARGET_H | 20 | #define HOTSWAP_TARGET_H |
21 | 21 | ||
22 | #include "inttypes.h" | 22 | #include "inttypes.h" |
23 | #include "hotswap.h" | ||
24 | 23 | ||
25 | typedef struct | 24 | typedef struct |
26 | { | 25 | { |
@@ -41,5 +40,6 @@ typedef struct | |||
41 | 40 | ||
42 | tCardInfo *card_get_info_target(int card_no); | 41 | tCardInfo *card_get_info_target(int card_no); |
43 | bool card_detect_target(void); | 42 | bool card_detect_target(void); |
43 | void card_enable_monitoring_target(bool on); | ||
44 | 44 | ||
45 | #endif | 45 | #endif |