fix qspi fal

This commit is contained in:
hathach committed 2018-10-24 21:19:58 +07:00
1 parent 3ad4fca64d
commit 739a61a4be
2 files changed
+5 -4

No files matched your search

+3 -3
View File
@@ -224,21 +224,21 @@ void flash_qspi_init (void)
bool fal_qspi_erase (uint32_t addr)
{
VERIFY(_flash_dev);
VERIFY_ERROR(nrfx_qspi_erase(NRF_QSPI_ERASE_LEN_4KB, addr), false);
VERIFY(NRFX_SUCCESS == nrfx_qspi_erase(NRF_QSPI_ERASE_LEN_4KB, addr));
return true;
}
static uint32_t fal_qspi_program (uint32_t dst, void const * src, uint32_t len)
{
VERIFY(_flash_dev, 0);
VERIFY_ERROR(nrfx_qspi_write(src, len, dst), 0);
VERIFY(NRFX_SUCCESS == nrfx_qspi_write(src, len, dst));
return len;
}
static uint32_t fal_qspi_read (void* dst, uint32_t src, uint32_t len)
{
VERIFY(_flash_dev, 0);
VERIFY_ERROR(nrfx_qspi_read(dst, len, src), 0);
VERIFY(NRFX_SUCCESS == nrfx_qspi_read(dst, len, src));
return len;
}
+2 -1
View File
@@ -117,7 +117,6 @@ FatFS::FatFS ()
FatFS::~FatFS ()
{
if (_fs) rtos_free(_fs);
}
bool FatFS::begin ()
@@ -131,6 +130,8 @@ bool FatFS::begin ()
// If FileSystem is not available, format it
if ( FR_NO_FILESYSTEM == err )
{
LOG_LV1("FATFS", "No file system, format it");
uint8_t workbuf[FF_MAX_SS];
VERIFY_FAT(f_mkfs("", FM_FAT | FM_SFD, 4096, workbuf, FF_MAX_SS), false);