art_pi_fw/src/hw/driver/fs.c
// Erase a block. A block must be erased before being programmed.
// The state of an erased block is undefined. Negative error codes
// are propogated to the user.
// May return LFS_ERR_CORRUPT if the block should be considered bad.
Erase a block. A block must be erased before being programmed.
The state of an erased block is undefined. Negative error codes
are propogated to the user.
May return LFS_ERR_CORRUPT if the block should be considered bad.
Erase a block . A block must be erased before being programmed . The state of an erased block is undefined . Negative error codes are propogated to the user . May return LFS_ERR_CORRUPT if the block should be considered bad .
int fsDeviceErase(const struct lfs_config *c, lfs_block_t block)
{
  int err = LFS_ERR_OK;
  bool ret;
  uint32_t addr;
  addr = block * c->block_size;
  ret =spiFlashEraseSector(addr);
  if (ret != true)
  {
    err = LFS_ERR_IO;
  }
  return err;
}
int fsDeviceErase ( const struct lfs_config * c , lfs_block_t block ) { int err = LFS_ERR_OK ; bool ret ; uint32_t addr ; addr = block * c -> block_size ; ret = spiFlashEraseSector ( addr ) ; if ( ret != true ) { err = LFS_ERR_IO ; } return err ; }
Erase a block.
Erase a block .