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

Method write_page

avr/libraries/Flash/src/Flash.cpp:139–153  ·  view source on GitHub ↗

* @brief Writes the current content of the RAM buffer to a flash page * * @param flash_page_number page number to write the buffer to */

Source from the content-addressed store, hash-verified

137 * @param flash_page_number page number to write the buffer to
138 */
139void Flash::write_page(uint16_t flash_page_number)
140{
141 // For devices with 128kiB or more, and data is stored in far progmem
142 #ifdef RAMPZ
143 if(_far_flash_array_addr != 0x0000)
144 {
145 urbootPageWrite(_ram_array, (progmem_t)(_far_flash_array_addr + SPM_PAGESIZE * flash_page_number));
146 }
147 // For devices with where flash space is allocated in near progmem, <64kiB
148 else
149 #endif
150 {
151 urbootPageWrite(_ram_array, (progmem_t)(_flash_array + SPM_PAGESIZE * flash_page_number));
152 }
153}
154
155/**
156 * @brief Reads a flash page and write its content to the RAM buffer

Callers

nothing calls this directly

Calls 1

urbootPageWriteFunction · 0.85

Tested by

no test coverage detected