art_pi_fw/src/hw/driver/fs.c
// Read a region in a block. Negative error codes are propogated
// to the user.
Read a region in a block. Negative error codes are propogated
to the user.
Read a region in a block . Negative error codes are propogated to the user .
int fsDeviceRead(const struct lfs_config *c, lfs_block_t block,
        lfs_off_t off, void *buffer, lfs_size_t size)
{
  int err = LFS_ERR_OK;
  bool ret;
  uint32_t addr;
  addr = block * c->block_size + off;
  ret =spiFlashRead(addr, (uint8_t *)buffer, size);
  if (ret != true)
  {
    err = LFS_ERR_IO;
  }
  return err;
}
int fsDeviceRead ( const struct lfs_config * c , lfs_block_t block , lfs_off_t off , void * buffer , lfs_size_t size ) { int err = LFS_ERR_OK ; bool ret ; uint32_t addr ; addr = block * c -> block_size + off ; ret = spiFlashRead ( addr , ( uint8_t * ) buffer , size ) ; if ( ret != true ) { err = LFS_ERR_IO ; } return err ; }
Read a region in a block.
Read a region in a block .