MCPcopy Create free account
hub / github.com/MCUdude/MiniCore / write

Method write

avr/libraries/Flash/src/Flash.cpp:118–132  ·  view source on GitHub ↗

* @brief Writes the current content of the RAM buffer to anywhere in flash. * Will need to read, modify & write. * * @param flash_start_address address to start writing to * @param length number of bytes to write * @param ram_buffer_start_address optional start address for the data * that's being written to flash */

Source from the content-addressed store, hash-verified

116 * that's being written to flash
117 */
118void Flash::write(uint16_t flash_start_address, uint16_t length, uint16_t ram_buffer_start_address)
119{
120 // For devices with 128kiB or more, and data is stored in far progmem
121 #ifdef RAMPZ
122 if(_far_flash_array_addr != 0x0000)
123 {
124 urflashWrite(_ram_array + ram_buffer_start_address, (uintpgm_t)_far_flash_array_addr + flash_start_address, length);
125 }
126 // For devices with where flash space is allocated in near progmem, <64kiB
127 else
128 #endif
129 {
130 urflashWrite(_ram_array + ram_buffer_start_address, (uintpgm_t)_flash_array + flash_start_address, length);
131 }
132}
133
134/**
135 * @brief Writes the current content of the RAM buffer to a flash page

Callers

nothing calls this directly

Calls 1

urflashWriteFunction · 0.85

Tested by

no test coverage detected