Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8_t sd_multiread_next(void)
- {
- extern uint8_t dac_buf[dac_buf_size];
- extern uint32_t sd_addr;
- uint32_t tmr=0;
- uint8_t res=res_ERROR,rc=0;
- tmr = 30000;
- do { //Wait for data packet in timeout of 100ms
- rc = sd_txrx_byte(SD_DUMMY_BYTE);
- } while (rc == 0xFF && --tmr);
- if (rc == 0xFE) {
- for (tmr = 0; tmr < SD_BLOCK_SIZE; tmr++) {
- //push data to ring buffer
- //
- dac_buf[tmr]=sd_txrx_byte(SD_DUMMY_BYTE);
- }
- sd_txrx_byte(SD_DUMMY_BYTE);//get 2 bytes of crc into /dev/null
- sd_txrx_byte(SD_DUMMY_BYTE);
- res = res_OK;
- }
- if (res==res_OK)
- if (!(CardType & CT_BLOCK)) sd_addr+=SD_BLOCK_SIZE;
- else sd_addr++;
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement