Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/firmware/target/arm/as3525/sd-as3525v2.c
- +++ b/firmware/target/arm/as3525/sd-as3525v2.c
- @@ -53,9 +53,14 @@
- #define INTERNAL_AS3525 0 /* embedded SD card */
- #define SD_SLOT_AS3525 1 /* SD slot if present */
- +#define SD_BLOCKED_DRIVE INTERNAL_AS3525
- +#define SD_REDIRECT_DRIVE SD_SLOT_AS3525
- /* Clipv2 Clip+ and Fuzev2 OF all occupy the same size */
- +#if SD_BLOCKED_DRIVE == INTERNAL_AS3525
- +#define AMS_OF_SIZE 0x0
- +#else
- #define AMS_OF_SIZE 0xf000
- -
- +#endif
- /* command flags */
- #define MCI_NO_RESP (0<<0)
- #define MCI_RESP (1<<0)
- @@ -449,12 +454,15 @@
- return true;
- }
- -static int sd_wait_for_tran_state(const int drive)
- +static int sd_wait_for_tran_state(int drive)
- {
- unsigned long response;
- unsigned int timeout = current_tick + 5*HZ;
- int cmd_retry = 10;
- -
- +#ifdef SD_BLOCKED_DRIVE
- +if (drive == SD_BLOCKED_DRIVE)
- + drive = SD_REDIRECT_DRIVE;
- +#endif
- while (1)
- {
- while (!send_cmd(drive, SD_SEND_STATUS, card_info[drive].rca, MCI_RESP,
- @@ -477,7 +485,7 @@
- }
- -static int sd_init_card(const int drive)
- +static int sd_init_card(int drive)
- {
- unsigned long response;
- long init_timeout;
- @@ -485,7 +493,10 @@
- card_info[drive].initialized = 0;
- card_info[drive].rca = 0;
- -
- +#ifdef SD_BLOCKED_DRIVE
- +if (drive == SD_BLOCKED_DRIVE)
- + drive = SD_REDIRECT_DRIVE;
- +#endif
- /* assume 24 MHz clock / 60 = 400 kHz */
- MCI_CLKDIV = (MCI_CLKDIV & ~(0xFF)) | 0x3C; /* CLK_DIV_0 : bits 7:0 */
- @@ -756,6 +767,10 @@
- {
- unsigned long response;
- int ret = 0;
- +#ifdef SD_BLOCKED_DRIVE
- +if (drive == SD_BLOCKED_DRIVE)
- + drive = SD_REDIRECT_DRIVE;
- +#endif
- #ifndef HAVE_MULTIDRIVE
- const int drive = 0;
- #endif
- @@ -978,6 +993,10 @@
- bool sd_present(IF_MD_NONVOID(int drive))
- {
- +#ifdef SD_BLOCKED_DRIVE
- +if (drive == SD_BLOCKED_DRIVE)
- + drive = SD_REDIRECT_DRIVE;
- +#endif
- return (drive == INTERNAL_AS3525) ? true : card_detect_target();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement