Skip to content

Commit

Permalink
InternalStorageRenesas - smaller flash usage
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy committed Aug 29, 2023
1 parent f296201 commit 37ac78a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/InternalStorageRenesas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ extern "C" {
#include "utility/r_flash_lp_cf.h"
}

const flash_api_t& flash = g_flash_on_flash_lp;
static flash_lp_instance_ctrl_t flashCtrl;
static flash_cfg_t flashCfg;

Expand Down Expand Up @@ -97,7 +96,7 @@ int InternalStorageRenesasClass::open(int length) {
flashWriteAddress = storageStartAddress;
writeIndex = 0;

fsp_err_t rv = flash.open(&flashCtrl, &flashCfg);
fsp_err_t rv = R_FLASH_LP_Open(&flashCtrl, &flashCfg);
if (rv != FSP_SUCCESS)
return 0;

Expand Down Expand Up @@ -130,11 +129,11 @@ void InternalStorageRenesasClass::close() {
while (writeIndex) {
write(0xff);
}
flash.close(&flashCtrl);
R_FLASH_LP_Close(&flashCtrl);
}

void InternalStorageRenesasClass::apply() {
fsp_err_t rv = flash.open(&flashCtrl, &flashCfg);
fsp_err_t rv = R_FLASH_LP_Open(&flashCtrl, &flashCfg);
if (rv != FSP_SUCCESS)
return;
__disable_irq();
Expand Down

0 comments on commit 37ac78a

Please sign in to comment.