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

RAII object for disabling, then restoring RAM execute never mode Usage: More...

#include <ScopedRamExecutionLock.h>

Inheritance diagram for ScopedRamExecutionLock:
NonCopyable< ScopedRamExecutionLock >

Public Member Functions

 ScopedRamExecutionLock ()
 Allow execution from RAM. More...
 
 ~ScopedRamExecutionLock ()
 Restore previous execution from RAM settings. More...
 

Detailed Description

RAII object for disabling, then restoring RAM execute never mode Usage:

void f() {
// some code here
{
ScopedRamExecutionLock make_ram_executable;
// Code in this block is allowed to call functions in RAM
}
// Execution from RAM is no longer allowed
}
RAII object for disabling, then restoring RAM execute never mode Usage:

Definition at line 42 of file ScopedRamExecutionLock.h.

Constructor & Destructor Documentation

◆ ScopedRamExecutionLock()

Allow execution from RAM.

Increment the execute never lock to ensure code can be executed from RAM. This class uses RAII to allow execution from ram while it is in scope.

Definition at line 52 of file ScopedRamExecutionLock.h.

◆ ~ScopedRamExecutionLock()

Restore previous execution from RAM settings.

Decrement the execute never lock to return execute from RAM to its prior state.

Definition at line 63 of file ScopedRamExecutionLock.h.