Mbed OS Reference
Loading...
Searching...
No Matches
ScopedRomWriteLock Class Reference

RAII object for disabling, then restoring ROM write never mode Usage: More...

#include <ScopedRomWriteLock.h>

Inheritance diagram for ScopedRomWriteLock:
NonCopyable< ScopedRomWriteLock >

Public Member Functions

 ScopedRomWriteLock ()
 Allow writing to ROM.
 
 ~ScopedRomWriteLock ()
 Restore previous write to ROM settings.
 

Detailed Description

RAII object for disabling, then restoring ROM write never mode Usage:

void f() {
// some code here
{
ScopedRomWriteLock make_ram_executable;
// Code in this block is allowed to write to ROM
}
// Writing to ROM is no longer allowed
}
RAII object for disabling, then restoring ROM write never mode Usage:

Definition at line 42 of file ScopedRomWriteLock.h.

Constructor & Destructor Documentation

◆ ScopedRomWriteLock()

Allow writing to ROM.

Increment the ROM write lock to ensure code can write to ROM. This class uses RAII to allow writing to ROM while it is in scope.

Definition at line 52 of file ScopedRomWriteLock.h.

◆ ~ScopedRomWriteLock()

Restore previous write to ROM settings.

Decrement the ROM write lock to return ROM write to its prior state.

Definition at line 63 of file ScopedRomWriteLock.h.