summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c14
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c10
2 files changed, 12 insertions, 12 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 5bed36e51e..c80c7f7491 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -693,7 +693,7 @@ static int sd_select_bank(signed char bank)
693 return 0; 693 return 0;
694} 694}
695 695
696static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, 696static int sd_transfer_sectors(IF_MD(int drive,) unsigned long start,
697 int count, void* buf, const bool write) 697 int count, void* buf, const bool write)
698{ 698{
699#ifndef HAVE_MULTIDRIVE 699#ifndef HAVE_MULTIDRIVE
@@ -887,19 +887,19 @@ sd_transfer_error_nodma:
887 return ret; 887 return ret;
888} 888}
889 889
890int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count, 890int sd_read_sectors(IF_MD(int drive,) unsigned long start, int count,
891 void* buf) 891 void* buf)
892{ 892{
893 int ret; 893 int ret;
894 894
895 mutex_lock(&sd_mtx); 895 mutex_lock(&sd_mtx);
896 ret = sd_transfer_sectors(IF_MD2(drive,) start, count, buf, false); 896 ret = sd_transfer_sectors(IF_MD(drive,) start, count, buf, false);
897 mutex_unlock(&sd_mtx); 897 mutex_unlock(&sd_mtx);
898 898
899 return ret; 899 return ret;
900} 900}
901 901
902int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, 902int sd_write_sectors(IF_MD(int drive,) unsigned long start, int count,
903 const void* buf) 903 const void* buf)
904{ 904{
905#ifdef VERIFY_WRITE 905#ifdef VERIFY_WRITE
@@ -911,7 +911,7 @@ int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
911 911
912 mutex_lock(&sd_mtx); 912 mutex_lock(&sd_mtx);
913 913
914 ret = sd_transfer_sectors(IF_MD2(drive,) start, count, (void*)buf, true); 914 ret = sd_transfer_sectors(IF_MD(drive,) start, count, (void*)buf, true);
915 915
916#ifdef VERIFY_WRITE 916#ifdef VERIFY_WRITE
917 if (ret) { 917 if (ret) {
@@ -928,10 +928,10 @@ int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
928 if(transfer > UNALIGNED_NUM_SECTORS) 928 if(transfer > UNALIGNED_NUM_SECTORS)
929 transfer = UNALIGNED_NUM_SECTORS; 929 transfer = UNALIGNED_NUM_SECTORS;
930 930
931 sd_transfer_sectors(IF_MD2(drive,) start, transfer, aligned_buffer, false); 931 sd_transfer_sectors(IF_MD(drive,) start, transfer, aligned_buffer, false);
932 if (memcmp(buf, aligned_buffer, transfer * 512) != 0) { 932 if (memcmp(buf, aligned_buffer, transfer * 512) != 0) {
933 /* try the write again in the hope to repair the damage */ 933 /* try the write again in the hope to repair the damage */
934 sd_transfer_sectors(IF_MD2(drive,) saved_start, saved_count, saved_buf, true); 934 sd_transfer_sectors(IF_MD(drive,) saved_start, saved_count, saved_buf, true);
935 panicf("sd: verify failed: sec=%ld n=%d!", start, transfer); 935 panicf("sd: verify failed: sec=%ld n=%d!", start, transfer);
936 } 936 }
937 937
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 9edc598edf..ae3dde4495 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -773,7 +773,7 @@ int sd_init(void)
773 return 0; 773 return 0;
774} 774}
775 775
776static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, 776static int sd_transfer_sectors(IF_MD(int drive,) unsigned long start,
777 int count, void* buf, bool write) 777 int count, void* buf, bool write)
778{ 778{
779 unsigned long response; 779 unsigned long response;
@@ -969,16 +969,16 @@ sd_transfer_error_no_dma:
969 } 969 }
970} 970}
971 971
972int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count, 972int sd_read_sectors(IF_MD(int drive,) unsigned long start, int count,
973 void* buf) 973 void* buf)
974{ 974{
975 return sd_transfer_sectors(IF_MD2(drive,) start, count, buf, false); 975 return sd_transfer_sectors(IF_MD(drive,) start, count, buf, false);
976} 976}
977 977
978int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, 978int sd_write_sectors(IF_MD(int drive,) unsigned long start, int count,
979 const void* buf) 979 const void* buf)
980{ 980{
981 return sd_transfer_sectors(IF_MD2(drive,) start, count, (void*)buf, true); 981 return sd_transfer_sectors(IF_MD(drive,) start, count, (void*)buf, true);
982} 982}
983 983
984#ifndef BOOTLOADER 984#ifndef BOOTLOADER