art_pi_fw/src/hw/driver/fs.c
// Program a region in a block. The block must have previously
// been erased. Negative error codes are propogated to the user.
// May return LFS_ERR_CORRUPT if the block should be considered bad.
Program a region in a block. The block must have previously
been erased. Negative error codes are propogated to the user.
May return LFS_ERR_CORRUPT if the block should be considered bad.
Program a region in a block . The block must have previously been erased . Negative error codes are propogated to the user . May return LFS_ERR_CORRUPT if the block should be considered bad .
int fsDeviceProg(const struct lfs_config *c, lfs_block_t block,
        lfs_off_t off, const void *buffer, lfs_size_t size)
{
  int err = LFS_ERR_OK;
  bool ret;
  uint32_t addr;
  addr = block * c->block_size + off;
  ret =spiFlashWrite(addr, (uint8_t *)buffer, size);
  if (ret != true)
  {
    err = LFS_ERR_IO;
  }
  return err;
}
int fsDeviceProg ( const struct lfs_config * c , lfs_block_t block , lfs_off_t off , const void * buffer , lfs_size_t size ) { int err = LFS_ERR_OK ; bool ret ; uint32_t addr ; addr = block * c -> block_size + off ; ret = spiFlashWrite ( addr , ( uint8_t * ) buffer , size ) ; if ( ret != true ) { err = LFS_ERR_IO ; } return err ; }
Program a region in a block.
Program a region in a block .