Permalink
Browse files

Add a missing optimization for SD data streaming

Transmission status was not set to TRANS_MID after the first partial
read of a sector following a seek.
Thus on reading after every seek one unnecessary stop and sector re-read
was issued.
  • Loading branch information...
mrehkopf committed Apr 30, 2017
1 parent 40203b7 commit fe47ec2135f240d6d8ab374e25b995b107a922f5
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/sdnative.c
View
@@ -480,15 +480,16 @@ int send_command_fast(uint8_t* cmd, uint8_t* rsp, uint8_t* buf){
}
if(sd_offload_partial_end != 512) {
sd_offload_partial_end |= 0x8000;
during_blocktrans = TRANS_MID;
}
DBG_SD_OFFLOAD printf("new partial %d - %d\n", sd_offload_partial_start, sd_offload_partial_end);
fpga_set_sddma_range(sd_offload_partial_start, sd_offload_partial_end);
fpga_sddma(sd_offload_tgt, 1);
// sd_offload_partial=0;
last_offset=sd_offload_partial_end;
last_offset = sd_offload_partial_end & 0x1ff;
} else {
fpga_sddma(sd_offload_tgt, 0);
last_offset=0;
last_offset = 0;
}
state=CMD_RSP;
return rsplen;

0 comments on commit fe47ec2

Please sign in to comment.