예제 #1
0
int8_t STORAGE_Read (uint8_t lun, 
                 uint8_t *buf, 
                 uint32_t blk_addr,                       
                 uint16_t blk_len)
{
#if defined(BOOT)
  if (lun == 1) {
    if (fat12Read(buf, blk_addr, blk_len) != 0)
      return -1;
  }
  else 
#endif
    {
    if (SD_ReadSectors(buf, blk_addr, blk_len) != 0) {
      return -1;
    }
  }

  return 0;
}
예제 #2
0
int8_t STORAGE_Read (uint8_t lun,
                     uint8_t *buf,
                     uint32_t blk_addr,
                     uint16_t blk_len)
{
    if (lun == 1) {
        if (fat12Read(buf, blk_addr, blk_len) != 0) {
            return -1;
        }
    }
    else {
        if (SD_ReadSectors(buf,
                           blk_addr,
                           blk_len) != 0) {
            return -1;
        }
    }

    return 0;
}