ScopedRamExecutionLock
ScopedRamExecutionLock class hierarchy
The ScopedRamExecutionLock
class provides an RAII object for enabling execution from RAM. In other words, creating a ScopedRamExecutionLock object calls its constructor, which increments the RAM execution lock. The ScopedRamExecutionLock object automatically releases the RAM execution lock in its destructor when the object goes out of scope. Another way to look at this is when the ScopedRamExecutionLock object exists, it allows execution from RAM.
ScopedRamExecutionLock class reference
Public Member Functions | |
ScopedRamExecutionLock () | |
Allow execution from RAM. More... | |
~ScopedRamExecutionLock () | |
Restore previous execution from RAM settings. More... |
Example
This example shows how you can enable execution from RAM from main:
#include "mbed.h"
int main()
{
// Enable execution from RAM while in main
ScopedRamExecutionLock make_ram_executable;
some_function_in_ram();
}