【正文】
0。return 1。 } } //Send the start byte while(Read_Byte_SD()!=0xfe) {WDR()。//feed the dog} //Read off all the bytes in the block for(a=0。a{ WDR()。//feed the dog*Buffer=Read_Byte_SD()。 //serial(*Buffer)。 Buffer++。 } //Read CRC byte Read_Byte_SD()。 Read_Byte_SD()。 // Set SD_Chip_Select to high SD_Disable()。 //SEI()。 //reenable interrupts return 0。 } /*//read xx bytes no matter of misalignment!!*/unsigned char read_antimisaliment(unsigned long addr_temp,unsigned char *p_buffer, unsigned int length){unsigned int _length=0x0000。SD_Enable()。 while(SD_read_sector(addr_temp,p_buffer,length)){SD_Enable()。//length=0x0001。//to find a suuitable length to avoid misalignment_length+=0x0001。// _length+length==xxSD_set_length(length)。} ///if(_length==0x0000){return 0。}///addr_temp+=length。SD_Enable()。//SD_set_length(_length)。 SD_Enable()。//while(SD_read_sector(addr_temp,p_buffer,_length)){SD_Enable()。}SD_Enable()。//SD_set_length(length+_length)。//to read the rest bytes of the xx bytesreturn 0。}