Change MPU lock name for readability in FlashIAP

Change the variable names in FlashIAP from
'xn' to 'make_ram_executable' and from 'wn' to 'make_rom_writable' to
make the code more readable.
pull/8871/head
Russ Butler 2018-11-07 14:34:44 -06:00 committed by Martin Kojtal
parent 24f002d6dc
commit 58ed5c2f7d
1 changed files with 10 additions and 10 deletions

View File

@ -59,8 +59,8 @@ int FlashIAP::init()
int ret = 0; int ret = 0;
_mutex->lock(); _mutex->lock();
{ {
ScopedMpuXnLock xn; ScopedMpuXnLock make_ram_executable;
ScopedMpuWnLock wn; ScopedMpuWnLock make_rom_writable;
if (flash_init(&_flash)) { if (flash_init(&_flash)) {
ret = -1; ret = -1;
} }
@ -77,8 +77,8 @@ int FlashIAP::deinit()
int ret = 0; int ret = 0;
_mutex->lock(); _mutex->lock();
{ {
ScopedMpuXnLock xn; ScopedMpuXnLock make_ram_executable;
ScopedMpuWnLock wn; ScopedMpuWnLock make_rom_writable;
if (flash_free(&_flash)) { if (flash_free(&_flash)) {
ret = -1; ret = -1;
} }
@ -94,8 +94,8 @@ int FlashIAP::read(void *buffer, uint32_t addr, uint32_t size)
int32_t ret = -1; int32_t ret = -1;
_mutex->lock(); _mutex->lock();
{ {
ScopedMpuXnLock xn; ScopedMpuXnLock make_ram_executable;
ScopedMpuWnLock wn; ScopedMpuWnLock make_rom_writable;
ret = flash_read(&_flash, addr, (uint8_t *) buffer, size); ret = flash_read(&_flash, addr, (uint8_t *) buffer, size);
} }
_mutex->unlock(); _mutex->unlock();
@ -141,8 +141,8 @@ int FlashIAP::program(const void *buffer, uint32_t addr, uint32_t size)
prog_size = chunk; prog_size = chunk;
} }
{ {
ScopedMpuXnLock xn; ScopedMpuXnLock make_ram_executable;
ScopedMpuWnLock wn; ScopedMpuWnLock make_rom_writable;
if (flash_program_page(&_flash, addr, prog_buf, prog_size)) { if (flash_program_page(&_flash, addr, prog_buf, prog_size)) {
ret = -1; ret = -1;
break; break;
@ -189,8 +189,8 @@ int FlashIAP::erase(uint32_t addr, uint32_t size)
_mutex->lock(); _mutex->lock();
while (size) { while (size) {
{ {
ScopedMpuXnLock xn; ScopedMpuXnLock make_ram_executable;
ScopedMpuWnLock wn; ScopedMpuWnLock make_rom_writable;
ret = flash_erase_sector(&_flash, addr); ret = flash_erase_sector(&_flash, addr);
} }
if (ret != 0) { if (ret != 0) {