ScopedRomWriteLock
ScopedRomWriteLock class hierarchy
The ScopedRomWriteLock
class provides an RAII object for enabling writing to ROM. In other words, creating a ScopedRomWriteLock object calls its constructor, which increments the ROM write lock. The ScopedRomWriteLock object automatically releases the ROM write lock in its destructor when the object goes out of scope. Another way to look at this is when the ScopedRomWriteLock object exists, it allows writing to ROM.
ScopedRomWriteLock class reference
Public Member Functions | |
ScopedRomWriteLock () | |
Allow writing to ROM. More... | |
~ScopedRomWriteLock () | |
Restore previous write to ROM settings. More... |
Example
This example shows how you can enable writes to ROM from main.
/*
* Copyright (c) 2006-2020 Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*/
#include "mbed.h"
int main()
{
// Enable writing to ROM while in main
ScopedRomWriteLock make_rom_writable;
//custom_flash_programming();
}