Mistake on this page?
Report an issue in GitHub or email us

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();
}

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.